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

Free Support Forum - aspose.com

Error while trying to convert .doc file to PDF/A-1b

Hi,

I'm facing a problem while trying to convert a MSWord .doc file to a PDF/A-1b using Aspose.Words.

I use this code:

Document doc = new Document(this.m_inputWordFileName);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;
doc.Save(this.m_outputPdfFileName, pdfSaveOptions);

The framework gaves me the error (in french) "La référence d'objet n'est pas définie à une instance d'un objet", meaning null reference exception in english, with this stacktrace:

à x4adf554d20d941a6.xa4342d41912fa853.x1d76cba86350fef5(Int32 x9b0739496f8b5475)
à x4adf554d20d941a6.xa4342d41912fa853.x00358ffa9c9f03fc(Int32 x9b0739496f8b5475)
à x4adf554d20d941a6.xa4342d41912fa853.xc3819e13f60dd8e6()
à x4adf554d20d941a6.x3d1ad8ce75f0db3a.x1681db4c6032bcdb(x109e3389933c23a8 xdcf7b74ddd6caa25, xd4c1d21f07094800 x9b3f1d96a5b5faee, x954503abc583f675 x88a493fb6bc167aa)
à x4adf554d20d941a6.x4ddd0723770f9758.x3d62cd488a47fcfe()
à x4adf554d20d941a6.x4ddd0723770f9758.xc3819e13f60dd8e6(x3d1ad8ce75f0db3a xd3311d815ca25f02, Int32 xd284dd7d525c5491, Boolean x3175070523842c98, Boolean x4097fa47409be495)
à x4adf554d20d941a6.x3f7228e953be72ed.xd79114a9e7bc0d9e()
à x4adf554d20d941a6.x3f7228e953be72ed.xc3819e13f60dd8e6(x852fe8bb5ac31098 xe3e287548b3d01f5, Int32 xd284dd7d525c5491)
à x4adf554d20d941a6.x4af2add38e634ad4.xcbc2273143eac9ec(x852fe8bb5ac31098 xb6842aa1e60562e1)
à x4adf554d20d941a6.x4af2add38e634ad4.xc3819e13f60dd8e6(xc7f90d9c7c51cede xbbe2f7d7c86e0379)
à x4adf554d20d941a6.xea876d525d28ff96.xc3819e13f60dd8e6(x398b3bd0acd94b61 xd7e5673853e47af4)
à x4adf554d20d941a6.xac6c82c74ce247fb.xc3819e13f60dd8e6(Boolean xfad304b5f8f3bb5b)
à x4adf554d20d941a6.xa268fdb9ca040dde.xc3819e13f60dd8e6(Boolean xfad304b5f8f3bb5b)
à x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98(Document x3664041d21d73fdc, xdeb77ea37ad74c56 xdfde339da46db651)
à Aspose.Words.Document.UpdatePageLayout()
à Aspose.Words.Document.x410db0f4a89a6ef1(Boolean x24af0daafcd8fb8c)
à Aspose.Words.Document.get_xcde671c53995c411()
à Aspose.Words.Document.get_PageCount()
à xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x8556eed81191af11 x5ac1382edb7bf2c2)
à Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
à Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)

I'm currently using version 10.1.1.0 but I also tried latest version (11.1.0) and the problem still remains. I use the .net 3.5 client profile dlls and encountered this error on only one .doc file, all the others are correctly converted.

Regards,

Bertrand

Hi
Bertrand,


Thanks for your inquiry. Could you please attach your input Word document, you’re getting problems with, here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

Hi again,

Sure, here it is.

Thank you for your quick reply.

Bertrand

Hi Bertrand,


Thank you for inquiry. I am afraid, I could not reproduce this problem on my side. Could you please create a simple console application which reproduces the issue on your side and attach it here? We will take a closer look into what’s happening and provide you with some further feedback. I have attached output PDF file for your reference.

We'll investigate the issue at our end and guide you accordingly.

Hi Imran,

Please find here a zip archive containing a VS console project and the corresponding compiled binaries.

The error still occurs with this very simple code, using this .doc file.

Regards,

Bertrand

Hi Bertrand,


Thanks for your inquiry. We tested your document on our environment and all works fine. We used windows server 2003, windows 7. It appears that your application is having a problem on your test environment. Please try it on another computer and tell me how you go.

Hi Bertrand,


Thanks for your inquiry. With Aspose.Words v11.1.0, I was unable to reproduce this exception on my side either. Could you please try rendering the Word document, you’re getting this exception with, to PDF on a different machine and let us know your findings (e.g. details about the development environment on that machine etc).

Thank you for your cooperation.

Best Regards,

Hi Awais, Imran,

You were right, I managed to render the pdf correctly with the last version of the DLL. I think I made a mistake when trying to use it yesterday.

Everything works fine now, sorry for this waste of time, and thanks a lot for your great support !

Regards,

Bertrand

Hi Bertrand,


Thanks for your feedback. It is perfect that you managed to resolve the problem on your side. Please let us know any time you have any further queries.

Best Regards,