Hi,
I am getting an exception when trying to add an image to a PDF page I have created.
I have example code below as well as the exception I am receiving. I have been through all the support forum entries I could find, as well as stack overflow, and have yet to find a solution.
The barcode is being created correctly, as i have tested this by writing it to a file.
I have tried writing it to the file then creating a fileStream from it and using that for the AddImage method but that also does not work.
I am using Aspose.PDF version 18.1.0.0.
Thank you.
Exception:
System.Runtime.InteropServices.ExternalException
HResult=0x80004005
Message=A generic error occurred in GDI+.
Source=System.Drawing
StackTrace:
at System.Drawing.Imaging.Metafile..ctor(Stream stream)
We have tested your code with the latest version 18.1 of Aspose.Pdf and Aspose.BarCode for .NET APIs, and unable to replicate the said error in our environment. Kindly let us know the barcode text value which you are using to generate the barcode image.
The barcode text is just “000000001”.
I am able to turn off that exception and it ends up producing the barcode and adding the image successfully. But it still is showing that is is catching the exception for each of the calls it makes.
Kindly share the web address of the actual code example on GitHub and narrate all steps to replicate this error. We have executed your scenario with the latest versions Aspose APIs and could replicate the error. Your response is awaited.
Did you try with the latest copy of GitHub project and in what line of code you can see this error. Kindly send us a snapshot. We have downloaded the latest copy of the GitHub project and followed all your narrated steps, but could not replicate the error. Snapshot: https://i.imgur.com/reUoDIq.png
This type of error sometimes occurs when the memory is not released. Please try to load the image with Using statement, and then let us know how that goes into your environment.
We have followed all these steps and could not replicate this error in our environment. Kindly send all details of your environment, including operating system (name and edition), Visual Studio and local language settings, etc. Please also create a small project application, which reproduces this error in your environment, and then send us a Zip of this project. We will investigate and share our findings with you.