Doc to pdf conversion throws NullReferenceException using C#

Hi.

Im trying to convert a word document with this code

var wordstream = File.OpenRead(@“XXX.doc”);
var word = new Aspose.Words.Document(wordstream);
word.Save(@“YYY\testword.pdf”, Aspose.Words.Saving.SaveOptions.CreateSaveOptions(Aspose.Words.SaveFormat.Tiff));

and im getting this exception.


ex
System.NullReferenceException: Object reference not set to an instance of an object.
at x4adf554d20d941a6.x3755d583e822e6e7.xc4f15cc34fe01653(x56410a8dd70087c5 x5906905c888d3d98, ArrayList x7803f13111e0fc76, x56410a8dd70087c5 x4a2eb580be8dbc84)
at x4adf554d20d941a6.x3755d583e822e6e7.xa7f8ff777cfe3e2e(x56410a8dd70087c5[] x6d394cddc56557db)
at x4adf554d20d941a6.x3755d583e822e6e7.x97f817c959ba4c2b(x56410a8dd70087c5[] x6d394cddc56557db, Boolean xaca20ac81928ea4a, Boolean x9181e70557163b43)
at x4adf554d20d941a6.x3755d583e822e6e7.xf7390e8e427dfeb0(x56410a8dd70087c5 x62584df2cb5d40dd, x56410a8dd70087c5 x2aa5114a5da7d6c8)
at x4adf554d20d941a6.x6d3ade29d016f4ea.x58c64f348653f92a()
at x4adf554d20d941a6.x6d3ade29d016f4ea.x5f6867bc5a977cb1()
at x4adf554d20d941a6.x6d3ade29d016f4ea.xc3819e13f60dd8e6(xf6937c72cebe4ad1 x311e7a92306d7199, Int32 xbfb9ad5ef64f6dc5)
at x4adf554d20d941a6.x20de8d9377d7de69.xc3819e13f60dd8e6(xf6937c72cebe4ad1 x311e7a92306d7199)
at x4adf554d20d941a6.x09e62a55cab70965.x5de571cf1cd1652c(xf6937c72cebe4ad1 x311e7a92306d7199)
at x4adf554d20d941a6.x09e62a55cab70965.xc3819e13f60dd8e6(xf6937c72cebe4ad1 x311e7a92306d7199, Int32 xcd3a9f82634fe5f9)
at x4adf554d20d941a6.x71da84fff8849445.xc3819e13f60dd8e6(x53cb1139c5c64ee6 xd7e5673853e47af4, Int32 xcd3a9f82634fe5f9, Boolean x3175070523842c98)
at x4adf554d20d941a6.x4ddd0723770f9758.xb47a6df2eae4ba51()
at x4adf554d20d941a6.x4ddd0723770f9758.xc3819e13f60dd8e6(x3d1ad8ce75f0db3a xd3311d815ca25f02, Int32 xd284dd7d525c5491, Boolean x3175070523842c98, Boolean x4097fa47409be495)
at x4adf554d20d941a6.x3f7228e953be72ed.xd79114a9e7bc0d9e()
at x4adf554d20d941a6.x3f7228e953be72ed.xc3819e13f60dd8e6(x852fe8bb5ac31098 xe3e287548b3d01f5, Int32 xd284dd7d525c5491)
at x4adf554d20d941a6.x4af2add38e634ad4.xcbc2273143eac9ec(x852fe8bb5ac31098 xb6842aa1e60562e1)
at x4adf554d20d941a6.x4af2add38e634ad4.xc3819e13f60dd8e6(xc7f90d9c7c51cede xbbe2f7d7c86e0379)
at x4adf554d20d941a6.xea876d525d28ff96.xc3819e13f60dd8e6(x398b3bd0acd94b61 xd7e5673853e47af4)
at x4adf554d20d941a6.xac6c82c74ce247fb.xc3819e13f60dd8e6(Boolean xfad304b5f8f3bb5b)
at x4adf554d20d941a6.xa268fdb9ca040dde.xc3819e13f60dd8e6(Boolean xfad304b5f8f3bb5b)
at x4adf554d20d941a6.x4e2f8bff72d83f71.xc3819e13f60dd8e6()
at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98(Document x3664041d21d73fdc, xdeb77ea37ad74c56 xdfde339da46db651)
at Aspose.Words.Document.UpdatePageLayout()
at Aspose.Words.Document.x410db0f4a89a6ef1(Boolean x24af0daafcd8fb8c)
at Aspose.Words.Document.get_xcde671c53995c411()
at x077e797660ceec8d.x39513200ff58c2e3.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at AsposeTest.Program.Main(String[] args) in C:\Users\ram.ZBANG-LOCAL\Documents\Visual Studio 2010\Projects\TestWebSite\Aspose\Program.cs:line 32

anyone know what the problem might me. i guess it something in the document but with the evaluation key everything work out with this document

Hi Eidan,

Thanks for your query. It would be great, if you share your document for investigation purposes.

Hi.

The file is attached.
Thanks

Hi Eidan,

Thanks for sharing the document. Please use the latest version of Aspose.Words for .NET. I have not faced any exception while using latest version of Aspose.Words for .NET. Please find the output PDF file in attachment.

Hi Tahir

Im using the same version of the words like you ( i download the dll yesterday).
The dll version im using is 11.3.0.0

Eidan

Hi Eidan,

Thanks for sharing the information. I would be great, If you share your working enviornment like operating system, .NET framework etc. We are really keen to help you but need some more detail from your side.

Thanks.

Hi.

I’m working with 2 environments and it happen with both.
both
environments I’m using .net 4.0 ( full) the words dll is .net 2.0 ( didn’t see anything on the .net 4.0 on the zip file i downloaded from the web site).

on my local computer i got windows 7 64 bit.
on my azure environment i got windows server 2008 r2 64 bit.

both of the environments i cant convert this file.
Thanks

Hi Eidan,

Thanks for sharing the information. I have managed to reproduce this issue at my end. I have logged this issue in our issue tracking system and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-6322) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.