Open svantreeck opened 5 years ago
Also, this happens on netstandard 2.0/NetCoreApp 2.2 with a different stack trace using the 19.4 nuget package:
Exception thrown: 'System.NullReferenceException' in Aspose.Pdf.dll: 'Object reference not set to an instance of an object.'
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=zXBtwSBLzda2_G9a41IF5YQs=(Object #=zqRDmNVM=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=znGTCst0AWNesiDvV6Eq4rllDm2ulZ$3xQh5Vh_objbuj()
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=zSR2Tpot4nMtwQdYXI3xLlt0EJytNe6busA==(Object #=zqRDmNVM=, UInt32 #=zX$ZZP8I=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=z_qrD3AVS0GsHKyOIoWKkNiwWfmfYeA23UA==(Boolean #=zqRDmNVM=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=z_qrD3AVS0GsHKyOIoWKkNiwWfmfYeA23UA==(Boolean #=zqRDmNVM=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=z$SpgjR37J_YbwNc_D3_giTaCbBCxqRCyjw==()
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=zvNKzj4lUeqJEMgAPlxiCz6I0fscgSFlqd5oY2M0=(Object[] #=zqRDmNVM=, Type[] #=zX$ZZP8I=, Type[] #=zCq$X$PI=, Object[] #=zC1Gb71M=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=zYtbayufKcJpqUGOACug$yR9fosEe2J6jT85tdurYPYqE(Stream #=zqRDmNVM=, String #=zX$ZZP8I=, Object[] #=zCq$X$PI=, Type[] #=zC1Gb71M=, Type[] #=zAFl0CXU=, Object[] #=ziTWLoW8=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=zXHZm77uSJ3f9Vt8P$wEQoQTEwPFe(Stream #=zqRDmNVM=, String #=zX$ZZP8I=, Object[] #=zCq$X$PI=)
at #=qiU5gKTVK86AarXYAnvaBOxQOA0XVDuZru00A9_AYga4=.#=z6YuiouYDF8q3F6vgeUpLxyDEk5_9(Stream #=zqRDmNVM=, String #=zX$ZZP8I=, Object[] #=zCq$X$PI=)
at Aspose.Pdf.Document.#=zc987sPODI9gV(Stream #=zUBYR2bw=, SaveOptions #=zalZVzje3NyLF)
at Aspose.Pdf.Document.Save(Stream output)
@svantreeck
Thank you for contacting support.
We are investigating it in our environment and will get back to you with our findings soon.
PS: I work with Aspose as Developer Evangelist.
@svantreeck
Thank you for being patient.
We have tested the scenario with Aspose.PDF for .NET 19.5 in MacOS version 10.14.4 Mojave, but the problem did not reproduce. Would you please share a sample application with us so that we may investigate further and help you out.
I am also having this issue. It works when I run locally, but when deployed to our kubernates Debian environment, getting the same error as described in the original post.
I am seeing the same on OSX. This is the simplest example I could dream up to repro.
var file = new Aspose.Pdf.Document("origianl.pdf");
file.Save("new.pdf");
@brianjbeach @Serjster @svantreeck
In order to use the API in a non-Windows environment, please make sure to install the following packages:
Please note that such exceptions are usually caused due to the absence of required fonts. Please try to install the suggested packages in your system and in case you still face the issue, please let us know.
Having this same issue with the Aspose.PDF 20.10 on MacOS version 10.15.7 Catalina
I attempted to install libgdiplus via brew https://formulae.brew.sh/formula/mono-libgdiplus
I also have office installed so I should have the Microsoft Core Fonts installed
@abdul-kurtosys
Are you facing this issue while processing an existing PDF document or creating a new one from scratch? Please share some more details of the scenario along with the sample code snippet that you are using. Also, please try using Aspose.PDF for .NET 20.12 and let us know if an issue still persists.
PS: It is recommended to post such issues in our official forum where they can be addressed and tracked appropriately.
https://docs.aspose.com/pdf/net/hello-world-example/ I came across the same problem with this example. It crashed right at the document.save() method I am using macOs Big Sur v11.2.3
@xopxop I have recently configured libgdiplus on macOs Big Sur v11.2.3. You need to use the Mac Terminal and with sudo please execute following two commands in order. I hope this will resolve all the dependencies on your end and will install the package.
xcode-select --install
brew install mono-libgdiplus
Same on here, any updates? Offical Thread gets no updates, too. https://forum.aspose.com/t/null-reference-error-while-saving-the-document/15342
@danielgran
We regret to inform you that the earlier logged ticket is not yet resolved. The issue is currently under the phase of the investigation. We have also posted an update in the original official thread. You may please follow up there about progress on issue resolution.
We apologize for the inconvenience caused due to this bug.
@asadalikhan90
I found a rather messy workaround checking if every page is saveable. You guys dont mind fixing this asap? :D
Greeting
@danielgran
Please accept our humble apology for the inconvenience you have been facing. Sometimes, the resolution of an issue takes more time due to the nature of the issue's complexity. Some issues are dependant upon various internal components of the API and in order to fix them, a lot of work is required. These are some factors that cause a delay in issue resolution. Nevertheless, we have recorded your concerns and escalated the issue to the next level of priority. We will surely inform you as soon as it is rectified.
We again apologize for the trouble caused.
@asadalikhan90
Any updates on this?
At least mention in the documentation it's not supported on mac os.
@danielgran , @prasad-varade ,
We would like to share with you that the earlier logged issue has been resolved in Aspose.PDF for .NET 21.6. The bug fix notification has already been sent in the official thread as well. Please use the latest version of the API and let us know in case you face any issues.
@asadalikhan90 The update does not appear to have fixed the issue for me.
@Stepos36
Can you please confirm if you have installed msttcorefonts and libgdiplus packages in your environment? Please check if these packages are correctly installed and let us know about OS Name and Version in which you are facing this issue. Are you experiencing the same exception that is mentioned in this thread?
@asadalikhan90 I was able to resolve the issue by installing all the Latin fonts I have on my local machine into the container. The container runs on Windows. The exception and symptoms were more less the same. I updated the Aspose.Pdf version to 21.6.0 but it didn't resolve the issue. It was really confusing and took me about a full day of investigation. If, instead of a NullReferenceException, it gave a clear message, something like "Your local environments is missing fonts required for saving the document", it would save me (and anyone who runs into the issue) a plenty of time.
@Stepos36
We apologize for the inconvenience being faced. We have recorded your concerns and generated another ticket i.e. PDFNET-50116 in our issue management system to implement proper Exception Message in such cases. We will surely look into its details and let you know as soon as the ticket is resolved.
@asadalikhan90 any update for this err, I got this error too
@Xuan-Spider
Can you please explain which error you are you getting? The Original issue in this thread was already resolved in 21.6 version of the API. The reason behind the issue was absence of the required font(s). Please go through the above discussion and comments and try to install the required fonts in your system. In case issue still persists, please let us know by creating a new topic in Aspose.PDF official support forum where we will further proceed to assist you.
I am running into a NullReferenceException using Aspose.PDF 19.4 in my own application and narrowed it down to the Save method on a Document. To make sure it wasn't my code causing the issue, I tried running the hello world example in this repo but tweaked to save to a stream to match how my app was working, and got the below error. Any ideas how to fix this?