List of usage examples for com.itextpdf.text.pdf PdfName DEFAULTCMYK
PdfName DEFAULTCMYK
To view the source code for com.itextpdf.text.pdf PdfName DEFAULTCMYK.
Click Source Link
From source file:shared.SVGtoPDF.java
License:Open Source License
/** * Creates a PDF document.//from ww w . j a v a 2 s. co m * @param path * @param filename the path to the new PDF document * @throws DocumentException * @throws IOException * @throws SQLException */ public void createPdf(String svgDocument, Point size, String path) throws IOException, DocumentException { svgDocument = convertSVG(svgDocument); Document document = new Document(new Rectangle(size.x, size.y)); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(path)); //writer.setRgbTransparencyBlending(false); writer.setDefaultColorspace(PdfName.DEFAULTCMYK, PdfName.DEFAULTCMYK); document.open(); PdfContentByte cb = writer.getDirectContent(); PdfTemplate template = cb.createTemplate(size.x, size.y); drawSvg(svgDocument, template, size); cb.addTemplate(template, 0, 0); // step 5 document.close(); }