/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf) throws IOException, DocumentException { renderToPDF(file, pdf, null); }
private static Character checkVersion(String version) { final Character val = (Character) versionMap.get(version.trim()); if (val == null) { usage("Invalid PDF version number; use 1.2 through 1.7"); } return val; }
/** * Renders the XML file as a PDF file and return its bytes. * * @param bytes XML file bytes to render * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static byte[] renderToPDFBytes(byte[] bytes) throws IOException, DocumentException { byte[] b = renderToPDFBytes(bytes, null); return b; }
usage("Incorrect argument list."); pdfVersion = checkVersion(args[2]); PDFRenderer.renderToPDF(f, args[1], pdfVersion); } else { usage("File to render is not found: " + url); PDFRenderer.renderToPDF(url, args[1], pdfVersion);
/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(file); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }
usage("Incorrect argument list."); pdfVersion = checkVersion(args[2]); PDFRenderer.renderToPDF(f, args[1], pdfVersion); } else { usage("File to render is not found: " + url); PDFRenderer.renderToPDF(url, args[1], pdfVersion);
/** * Renders the XML file at the given URL as a PDF file * at the target location. * * @param url url for the XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the URL or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(String url, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }
usage("Incorrect argument list."); pdfVersion = checkVersion(args[2]); PDFRenderer.renderToPDF(f, args[1], pdfVersion); } else { usage("File to render is not found: " + url); PDFRenderer.renderToPDF(url, args[1], pdfVersion);
/** * Renders the XML file at the given URL as a PDF file * at the target location. * * @param url url for the XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the URL or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(String url, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }
/** * Renders the XML file as a PDF file at the target location. * * @param bytes XML file bytes to render * @param pdf path to the PDF file to create * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(byte[] bytes, String pdf) throws IOException, DocumentException { renderToPDF(bytes, pdf, null); }
private static Character checkVersion(String version) { final Character val = (Character) versionMap.get(version.trim()); if (val == null) { usage("Invalid PDF version number; use 1.2 through 1.7"); } return val; }
usage("Incorrect argument list."); pdfVersion = checkVersion(args[2]); PDFRenderer.renderToPDF(f, args[1], pdfVersion); } else { usage("File to render is not found: " + url); PDFRenderer.renderToPDF(url, args[1], pdfVersion);
/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(file); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }
/** * Renders the XML file at the given URL as a PDF file * at the target location. * * @param url url for the XML file to render * @param pdf path to the PDF file to create * @throws IOException if the URL or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(String url, String pdf) throws IOException, DocumentException { renderToPDF(url, pdf, null); } /**
private static Character checkVersion(String version) { final Character val = (Character) versionMap.get(version.trim()); if (val == null) { usage("Invalid PDF version number; use 1.2 through 1.7"); } return val; }
usage("Incorrect argument list."); pdfVersion = checkVersion(args[2]); PDFRenderer.renderToPDF(f, args[1], pdfVersion); } else { usage("File to render is not found: " + url); PDFRenderer.renderToPDF(url, args[1], pdfVersion);
/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(file); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }
/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf) throws IOException, DocumentException { renderToPDF(file, pdf, null); }
private static Character checkVersion(String version) { final Character val = (Character) versionMap.get(version.trim()); if (val == null) { usage("Invalid PDF version number; use 1.2 through 1.7"); } return val; }
/** * Renders the XML file as a PDF file at the target location. * * @param file XML file to render * @param pdf path to the PDF file to create * @param pdfVersion version of PDF to output; null uses default version * @throws IOException if the file or PDF location is * invalid * @throws DocumentException if an error occurred * while building the Document. */ public static void renderToPDF(File file, String pdf, Character pdfVersion) throws IOException, DocumentException { ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(file); if (pdfVersion != null) renderer.setPDFVersion(pdfVersion.charValue()); doRenderToPDF(renderer, pdf); }