Dear team,
we are trying to convert docx to pdf but it was not working please find source code and input docx
public static void convertWordtoPDF() throws Exception {
Document doc = new Document("input.docx");
doc.save("output.pdf");
}
input : R1-Manuscript-clean version.docx (251.9 KB)
@e503824 Could you please elaborate your problem a bit more. I have successfully converted your document to PDF using the latest 22.4 version of Aspose.Words for Java and the following simple code:
Document doc = new Document("C:\\Temp\\in.docx");
doc.save("C:\\Temp\\out.pdf");
Dear team,
I’m converting docx file to pdf but in this case Fig number 14th can’t convert into pdf that is the issue and im notable to attach full docx due to memory issue, here its showing 50000kb but my docx is 19500kb only anything possible to attach original docx. please do need full
we are getting below exception
exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerException
at com.aspose.words.zzZJ9.zzXx9(Unknown Source)
at com.aspose.words.zzZJ9.zzWZJ(Unknown Source)
at com.aspose.words.zzWeC.zzWZJ(Unknown Source)
at com.aspose.words.zzWeC.zzWZJ(Unknown Source)
at com.aspose.words.zzZKh.zzWBn(Unknown Source)
at com.aspose.words.zzZKh.zzXTn(Unknown Source)
at com.aspose.words.zzZKh.zzWBn(Unknown Source)
at com.aspose.words.zzZbg.zzZO7(Unknown Source)
at com.aspose.words.zzZbg.zzW07(Unknown Source)
at com.aspose.words.zzZEn.getWidth(Unknown Source)
at com.aspose.words.zzYf2.zzZjk(Unknown Source)
at com.aspose.words.zzi6.zzZU(Unknown Source)
at com.aspose.words.zzYpe.zzZQk(Unknown Source)
at com.aspose.words.zzYpe.zzXTn(Unknown Source)
at com.aspose.words.zzYpe.zzWLh(Unknown Source)
at com.aspose.words.zzW8T.zzWZJ(Unknown Source)
at com.aspose.words.zzW8T.zzYQa(Unknown Source)
at com.aspose.words.zzXPx.zzYD8(Unknown Source)
at com.aspose.words.zzZnN.zzXx9(Unknown Source)
at com.aspose.words.zzZnN.zzZfm(Unknown Source)
at com.aspose.words.zzZnN.zzWBn(Unknown Source)
at com.aspose.words.zzWLQ.zzWZJ(Unknown Source)
at com.aspose.words.zzWLQ.zzWZJ(Unknown Source)
at com.aspose.words.zzMO.zzWNa(Unknown Source)
at com.aspose.words.zzMO.zzWYI(Unknown Source)
at com.aspose.words.zzMO.zzWZJ(Unknown Source)
at com.aspose.words.zzWQo.zzZaV(Unknown Source)
at com.aspose.words.zzWQo.zzXTn(Unknown Source)
at com.aspose.words.zzWQo.zzYrK(Unknown Source)
at com.aspose.words.zz68.zzYzN(Unknown Source)
at com.aspose.words.zz68.zzYFL(Unknown Source)
at com.aspose.words.zz68.zzWNs(Unknown Source)
at com.aspose.words.zz68.zzYQa(Unknown Source)
at com.aspose.words.zzYE6.zzYlo(Unknown Source)
at com.aspose.words.zzXB8.zzZO7(Unknown Source)
at com.aspose.words.zzZZJ.zzYlo(Unknown Source)
at com.aspose.words.zzYhg.zzXcb(Unknown Source)
at com.aspose.words.zzZTB.zzXVi(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zzT0.zzWKY(Unknown Source)
at com.aspose.words.zzmD.zzZ1t(Unknown Source)
at com.aspose.words.zzXeQ.zzBX(Unknown Source)
at com.aspose.words.zzXeQ.zzWZJ(Unknown Source)
at com.aspose.words.zzXeQ.zzYM8(Unknown Source)
at com.aspose.words.Document.zzMw(Unknown Source)
at com.aspose.words.Document.zzWYI(Unknown Source)
at com.aspose.words.Document.zzWZJ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at asposeConversion.ConversionDocx2PDF.ConvertPDFtoWord(ConversionDocx2PDF.java:45)
at asposeConversion.ConversionDocx2PDF.main(ConversionDocx2PDF.java:33)
Caused by: java.lang.NullPointerException
at com.aspose.words.zzWEN.zzY9h(Unknown Source)
at com.aspose.words.zzWEN.zzWXM(Unknown Source)
at com.aspose.words.zzWEN.getShapeRenderer(Unknown Source)
at com.aspose.words.zzWEN.zzZ7g(Unknown Source)
at com.aspose.words.zzWEN.zzWYI(Unknown Source)
at com.aspose.words.zzG7.zzWZJ(Unknown Source)
at com.aspose.words.zzG7.zzWZJ(Unknown Source)
at com.aspose.words.zzW60.zzZaQ(Unknown Source)
at com.aspose.words.zzW60.zzXJd(Unknown Source)
at com.aspose.words.zzZwQ.zzWZJ(Unknown Source)
at com.aspose.words.zzZwQ.zzWZJ(Unknown Source)
at com.aspose.words.zzZwQ.zzWB6(Unknown Source)
at com.aspose.words.zzZwQ.zzYHo(Unknown Source)
at com.aspose.words.zzZwQ.zzW1d(Unknown Source)
at com.aspose.words.zzZwQ.zzWZJ(Unknown Source)
at com.aspose.words.zzZqY.zzWZJ(Unknown Source)
at com.aspose.words.zzZJ9.zzXx9(Unknown Source)
... 50 more
@e503824 Which version of Aspose.Words do you use? Please try using the latest 22.4 version of Aspose.Words for Java.
Can you please share me the jar file im notable to download the Jar file
@e503824 You can get the Jar via Maven. What problems with downloading from site do you have? Here is Aspose.Words Jar
file.