Hello i am using docx4j 2.8.0 and converting docx file into pdf file using following code in java
public static void test() throws Exception
{
String docxFile = "E://testData_20120814194757666.docx";
WordprocessingMLPackage pkg = WordprocessingMLPackage.load(new File(docxFile));
pkg.setFontMapper(new IdentityPlusMapper());
org.docx4j.convert.out.pdf.PdfConversion c = new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(pkg);
String pdfFile = changeExtensionToPdf(docxFile);
OutputStream os = new FileOutputStream(pdfFile);
c.output(os,new PdfSettings());
os.close();
}
public static String changeExtensionToPdf(String path)
{
int markerIndex = path.lastIndexOf(".docx");
String pdfFile = path.substring(0, markerIndex) + ".pdf";
return pdfFile;
}
public ...