PDF to Image (DotNetCore 2.1) - ERROR:region.c:1155:GdipCombineRegionPath: assertion failed: (region->bitmap)

@rjohansen,

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

Hi @imran.rafique and @rjohansen,

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.

@jacquesb,

We have recorded your feedback under the linked ticket ID PDFNET-44940, and let you know once a significant progress has been made in this regard.

Hi. I would like to know if this bug has been fixed?

@kityeo

Thank you for getting back to us.

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?

@ivanperever,

Thanks for contacting support.

Can you please share working sample project along with source files and environment details so that we may further investigate to help you out.

Here is the sample project @Adnan.Ahmad :

@ivanperever

Thanks for sharing the sample project.

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.

We are sorry for the inconvenience.

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.

dotnet_crash.pdf (128.3 KB)

@ivanperever

Thanks for sharing the crash report.

We have logged it as well and will consider it during investigation and let you know about the resolution status of the ticket as soon as we have some updates.

@asad.ali what’s the best way to escalate this? Could purchasing paid support help? This issue makes our service completely unusable atm, and we run out of ideas about what else to try

We tried to extract first page image preview using other vendor (ironpdf) with same document that crashes our our workers - and it worked. So this is not just document, something wrong with library.

@ivanperever

We will surely investigate the ticket as per your feedback and shared information.

You may please check our priority support option (As already shared in our previous comments) where issues are dealt with high precedence. In case you need further information, please feel free to let us know.

Just to comment on this issue. I was having the same issue, I detected this error is coming from the libgdiplus library. So initially I was using libgdi library version 4.2-1. I changed the source to download a newer version of libgdiplus version 6.0.4 to be exact and I stopped having this issue.

@GMarcucciBruce

It is good to know that your issue has been resolved and your comments under this thread are really appreciated. They would really be helpful for those who are facing similar issue.

Hi, I am also running into this error. Is there a fix available? I have tried updating libgdiplus but that doesn’t solve the issue for me. Thanks.

There are more than one reasons why you might end up with a maximum size limit issue. Instead of installing libgdiplus I downloaded libgdiplus source code, increase the memory size and recompiled.

This is the script that I added inside the docker file

#update libgdiplus with custom install
RUN apt-get update
&& apt-get install git -y
&& apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev -y

#clone libgdi plus source code
WORKDIR /usr/local/share
RUN git clone GitHub - mono/libgdiplus: C-based implementation of the GDI+ API

#patch max memory size
WORKDIR /usr/local/share/libgdiplus/src
RUN sed -i ‘s/1024/10240/g’ region-bitmap.h

#recompile
WORKDIR /usr/local/share/libgdiplus
RUN sh autogen.sh
&& make
&& make install

WORKDIR /usr/local/share
RUN rm -r libgdiplus

@zeeshan1

Would you please confirm if you were able to resolve the issue by the workaround that you have shared?

Is there an update about this? We are having the same issue.

Kind Regards.