use of org.docx4j.convert.out.pdf.viaXSLFO.PdfSettings in project mdw-designer by CenturyLinkCloud.
the class DocxBuilder method toPdf.
public byte[] toPdf() throws Exception {
Mapper fontMapper = new IdentityPlusMapper();
wordMLPackage.setFontMapper(fontMapper);
org.docx4j.convert.out.pdf.PdfConversion c = // = new org.docx4j.convert.out.pdf.viaHTML.Conversion(wordMLPackage);
new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(wordMLPackage);
// = new org.docx4j.convert.out.pdf.viaIText.Conversion(wordMLPackage);
// PdfConversion writes to an output stream
ByteArrayOutputStream os = new ByteArrayOutputStream();
c.output(os, new PdfSettings());
return os.toByteArray();
}
Aggregations