We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose conversion from Word to PDF is failing for a particular document

Hi Team,

We are facing intermittent issue while coverting aspose words to pdf file. We are getting below error while converting a particular document.

Please note :- operating system is red hat linux
JDK version :- open-jdk 11.
aspose words version:-20.6

Code Snippet :

public static void main(String[] args) throws Exception {

    com.aspose.words.License license = new com.aspose.words.License();
    File fLicense = new File("<<License Path>>");

    if (fLicense.exists())
    {
        license.setLicense(new java.io.FileInputStream(fLicense));
    }
    Document doc = new Document("<<Input Document Path>>");

    doc.save("<<Output Document Path>>", com.aspose.words.SaveFormat.PDF);

    MemoryCleaner.clear();
}

ERROR :

com.csg.cst.stratos.theama.aspose.impl.AsposeWordHandler
Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerException
at com.aspose.words.zz9C.zzz(Unknown Source)
at com.aspose.words.zz9C.zzZ(Unknown Source)
at com.aspose.words.zzBF.zzZ(Unknown Source)
at com.aspose.words.zzBF.zzZ(Unknown Source)
at com.aspose.words.zzZJM.zzU(Unknown Source)
at com.aspose.words.zzZJM.zzW(Unknown Source)
at com.aspose.words.zzZJM.zzV(Unknown Source)
at com.aspose.words.zzZJZ.zzb(Unknown Source)
at com.aspose.words.zzZJZ.zzZbw(Unknown Source)
at com.aspose.words.zzZJY.getWidth(Unknown Source)
at com.aspose.words.zzYT9.zz8a(Unknown Source)
at com.aspose.words.zzYU6.zzYh(Unknown Source)
at com.aspose.words.zzZIX.zzzX(Unknown Source)
at com.aspose.words.zzZIX.zzW(Unknown Source)
at com.aspose.words.zzZIX.zzUx(Unknown Source)
at com.aspose.words.zzZIQ.zzZ(Unknown Source)
at com.aspose.words.zzZIQ.zzM(Unknown Source)
at com.aspose.words.zzZJ0.zzF(Unknown Source)
at com.aspose.words.zzZIZ.zzz(Unknown Source)
at com.aspose.words.zzZIZ.zzU(Unknown Source)
at com.aspose.words.zzZIZ.zzV(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzYUQ.zzYyy(Unknown Source)
at com.aspose.words.zzYUQ.zzY(Unknown Source)
at com.aspose.words.zzYUQ.zzZ(Unknown Source)
at com.aspose.words.zzGJ.zzY(Unknown Source)
at com.aspose.words.zzGJ.zzM(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzYUQ.zzYyy(Unknown Source)
at com.aspose.words.zzYUQ.zzY(Unknown Source)
at com.aspose.words.zzYUQ.zzZ(Unknown Source)
at com.aspose.words.zzXI.zzab(Unknown Source)
at com.aspose.words.zzXI.zzW(Unknown Source)
at com.aspose.words.zzXI.zzX(Unknown Source)
at com.aspose.words.zzZ47.zzB(Unknown Source)
at com.aspose.words.zzZ47.zzC(Unknown Source)
at com.aspose.words.zzZ47.zzYNS(Unknown Source)
at com.aspose.words.zzZ47.zzL(Unknown Source)
at com.aspose.words.zzZ3J.zzI(Unknown Source)
at com.aspose.words.zzYSR.zz9(Unknown Source)
at com.aspose.words.zz8A.zzI(Unknown Source)
at com.aspose.words.zz8B.zzZDJ(Unknown Source)
at com.aspose.words.zzZ4C.zzYOb(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz31.zzZxk(Unknown Source)
at com.aspose.words.zz32.zzF0(Unknown Source)
at com.aspose.words.zzZZU.zzXU(Unknown Source)
at com.aspose.words.zzZZU.zzZ(Unknown Source)
at com.aspose.words.zzZZU.zzYW(Unknown Source)
at com.aspose.words.Document.zzZEY(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.csg.cst.stratos.theama.aspose.impl.AsposeWordHandler.main(AsposeWordHandler.java:79)
Caused by: java.lang.NullPointerException
at com.aspose.words.zz9I.zzZGW(Unknown Source)
at com.aspose.words.zz9I.zzZGS(Unknown Source)
at com.aspose.words.zz9I.getShapeRenderer(Unknown Source)
at com.aspose.words.zz9I.zzZGY(Unknown Source)
at com.aspose.words.zz9I.zzY(Unknown Source)
at com.aspose.words.zzIE.zzZ(Unknown Source)
at com.aspose.words.zz9D.zzZGM(Unknown Source)
at com.aspose.words.zz9D.zzZR(Unknown Source)
at com.aspose.words.zzIV.zzZ(Unknown Source)
at com.aspose.words.zzIV.zzY(Unknown Source)
at com.aspose.words.zzIV.zzZTl(Unknown Source)
at com.aspose.words.zzIV.zzZZ5(Unknown Source)
at com.aspose.words.zzIV.zzZ(Unknown Source)
at com.aspose.words.zzJ3.zzZ(Unknown Source)
at com.aspose.words.zz9C.zzz(Unknown Source)
... 56 more
Process finished with exit code 1

@theama Please, attach the source document here we will check the issue and provide you more information.

Document is large and it is failing while uploading. How do I upload?

@theama Could you, please, shorten your document to the smallest size that reproduces this issue? For example, this can be performed using a half division method in MS Word Editor. Or you can upload it to google drive and copy the link here.

I am unable to split the document. Can you please provide a link where I can upload? And Google drive is not allowed in our organisation

@theama Please archive the document using multiple volume archive.

Chunk 2.docx (459.5 KB)

Hi,
I was able to narrow the doc and found the chunk which is erroring out. PFA.

@theama
Thank you for additional information. I have reproduced this issue in version 20.6, and it is not reproduced in the latest release 22.6. Please, update to the Aspose.Words latest version.