public ImageData GenerateImage(byte[] pdfData, int pageNo)
{
var imageStream = new MemoryStream();
var pdfMemoryStream = new MemoryStream(pdfData);
var pdfDocument = new Document(pdfMemoryStream);
Resolution resolution = new Resolution(300);
var pageToPrint = pdfDocument.Pages[pageNo];
PngDevice pngDevice = new PngDevice(resolution);
//This line causes the error
pngDevice.Process(pageToPrint, imageStream );
}
Notes:
This works fine on a Windows machine but produces the error on a Linx 64bit Docker container.
Kindly send us your problematic source PDF file, and let us know the page number parameter. Please also share details of the Linux environment, e.g. Operating System (name & version) etc. Your response is awaited.
An investigation has been logged under the ticket ID PDFNET-44940 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.
Thank you for the feedback. Do you have any timelines for when this ticket will be addressed? (I need to make a few technical decisions for a new project and any sort of timeline from your side will really help with this)
We have just logged an investigation and it is difficult to share an estimate. Please install libgdiplus and ttf-mscorefonts-installer packages and also try with .NET Core 2.0, and then let us know how that goes into your environment. Please refer to this help topic: Working with .NET Core DLLs in Non-Windows Environment
I have just tested it with the suggested packages and the same error still occurs.
I do understand that timelines are difficult, but are we talking about days, weeks or months before I will get feedback on this issue?
Is there anything else that I can do to assist with the investigation?
Have you created the docker container to see the actual error message?
In order to escalate priority, we recommend our clients to post their critical issues (ticket Ids) in the paid support forum. Please refer to this helping link: Aspose support options. We are investigating your scenario, and will keep you informed regarding any available updates.
This information has been logged under the same ticket ID PDFNET-44940.
Is there anyway that we can expedite this - if we can get this to work then we will change our subscription from the Java version tot he .net core version.
Please also let me know how we can add maintenance onto our subscription so that we can get fast support on this.
As narrated in our previous post, you can escalate priority by posting the critical issues or ticket IDs in the paid support forum. Please refer to this helping link: Aspose support options. In order to gather details regarding the enhancement of subscription with Aspose, Please post in the Aspose.Purchase forum. We have created a separate thread in Aspose.Purchase forum, and will assist you there soon. https://forum.aspose.com/t/add-maintenance-onto-our-subscription/178783
Just some feedback. We managed to get the application to generate the image by changing the resolution to 147 instead of 300. (Any resolution higher than 147 will cause the application to crash with the above-mentioned exception.)
Unfortunately, 147 is not a magic number and have to be changed depending on the size of the PDF file. For instance, when I tried it with a 10 MB PDF file I had to lower the resolution. (I just tried 100 and it worked)
It is also worth mentioning, the image that got generated on Linux is different from the image generated on Windows using the same code base. (The Linux version omitted certain elements(images))
I trust that the Aspose team will look into this soon and provide a reliable workaround/fix.
We are afraid PDFNET-44940 is still unresolved owing to previously logged and critical tickets. We have recorded your concerns and will let you know once any update will be available.
Hi guys, we have similar error:
WARNING **: 03:01:03.016: Requested 0 bytes. Maximum size for region is 1073741824 bytes.
We already forked library and bumped upper limit, but as you see somehow aspose tries to allocate zero-length buffer.
Any suggestions on how to approach this?
We have updated the information against earlier logged ticket and will surely inform you as soon as it is completely investigated and resolved. Please spare us some time.
Here is dotnet crash report if that helps. We are having alot of issues with this in our application, similar documents crashing instances cause of attempts to allocate too much memory.