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

Free Support Forum - aspose.com

Error converting from word file to pdf

Hi all,

I’m trying to convert the word file “Manual.doc” to PDF but the following error appears:

ERROR DESCRIPTION [java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at com.aspose.words.ëD1.ëZ(Unknown Source)
at com.aspose.words.ëD1.ëY(Unknown Source)
and more…

This error appears when the file is created from Office 2003 and 2007, but the conversion is correct from Office 2010,

I attach the file “Manual.doc”.
Aspose Word Version: 13.9.0.0

Could you help me to solve this problem?

Best Regards
Martin Fernandez
Java Developer


Hi Martin,


Thanks for your inquiry. After an initial test with Aspose.Words 14.1.0, I was unable to reproduce this issue on my side. I suggest you please upgrade to the latest version from the following link:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

I hope, this helps.

Best regards,
Hi Awais,
we use Word Documents as templates, within these, there are some tags that are replaced by other MSOffice documents, and then generate a final PDF document.

Template (docx file) + MSOffice documents = PDF Output

For example the attached document template "Template.docx" contains the tag:
form.wordsection.name.Contenido.end

We replace this tag for an entire document (eg "Manual del Sistema de Gestión de la Calidad.doc") and then, using the Aspose API to generate the final PDF.

After replacing all tags and then generating the output PDF file, we get the error mentioned (NullPointerException).

We tried with versions 13.9, 14.1(trial) and 14.2 (trial) of Aspose Word and does not work, but works correctly with version 11.9.

I wanted to know if you could advise us to get to the solution.

Best Regards
Martin Fernandez
Java Developer

Hi Martin,


Thanks for the additional information. Please also share your Java source code to be able to reproduce this exception on our end.

Best regards,
Hi Awais,
I apologize for the delay in my response, here is my code, its very simple, its takes the final word file and make the pdf file.

com.aspose.words.Document document = new com.aspose.words.Document("word file path");
FontSettings.setFontsFolder("fonts path", true); //
document.save("pdf path");

Best Regards
Martin Fernandez
Java Developer

Hi Martin,


Thanks for the additional information. Using Aspose.Words for Java 14.3.0, we managed to convert all the Word documents you attached with this thread to PDF format on our side. Could you please also attach your final Word document you’re getting this problem with here for testing? We will investigate the issue further on our end and provide you more information.

Best regards,