I'm trying to convert a WordprocessingMLPackage instance to pdf format. This is the code I am using:
- Code: Select all
WordprocessingMLPackage document = WordprocessingMLPackage.load(new FileInputStream(new File("c:/report.docx")));
Mapper fontMapper = new IdentityPlusMapper();
document.setFontMapper(fontMapper);
File fo = new File("c:/report.fo");
File pdf = new File("c:/report.pdf");
org.docx4j.convert.out.pdf.PdfConversion converter = new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(document);
((org.docx4j.convert.out.pdf.viaXSLFO.Conversion)converter).setSaveFO(fo);
os = new FileOutputStream(pdf);
converter.output(os, new PdfSettings());
Basically the conversion works. But there are two problems I face:
1. the tabulator within the pdf file do not conform ...