/** * 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; }