I try to convert Word doc to PDF using Docx4j. I have a Table alignment problem.
table are aligned out of page and misaligned
I am working on Eclipse environment
docx4j-2.8.1 version
also have docx4j-nightly-20130813 jar
windows OS
jdk1.6.0_18
i have attachend my word doc and pdf out file
Please help me,
Thanks in Advance.
- Code: Select all
private static void createPDF() {
try {
// 1) Load DOCX into WordprocessingMLPackage
InputStream is = new FileInputStream(new File(
"docx/pdf_conversion_example_formate.docx"));
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.load(is);
// 2) Prepare Pdf settings
PdfSettings pdfSettings = new PdfSettings();
// 3) Convert WordprocessingMLPackage to Pdf
OutputStream out = new FileOutputStream(new File(
"pdf/pdf_conversion_example_formate.pdf"));
PdfConversion converter = new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(
wordMLPackage);
converter.output(out, pdfSettings);
System.err.println("done");
} catch (Throwable e) {
e.printStackTrace();
}
}