#1
Posted
:
Monday, June 8, 2015 11:30:28 AM(UTC)
Groups: Registered
Posts: 1
When converting large (225+ pages) PDF files to TIF files, I get an exception "You have exceeded the amount of memory allowed for RasterImage allocations. RasterDefaults::MemoryThreshold::MaximumGlobalRasterImageMemory". In googling for an answer, I came across this thread that discusses loading and saving the PDF one page at a time. I'm using code such as the attached, which I do understand is not paging through the PDF. Is there an example available of how best to manage the large PDFs. This code, BTW, runs in a Windows service; it is not a web service code nor does it run behnd a UI.
Thanks.
Jim McFadden
#2
Posted
:
Tuesday, June 9, 2015 5:00:45 AM(UTC)
Groups: Registered
Posts: 256
Jim,
There are not attachments in your post. Please don't use "Preview" option when uploading attachments as that will cause the attachments to be lost.
MaximumGlobalRasterImageMemory puts a limit of how much memory can the RasterImage object use. This prevents it from eating all the available memory.
The memory needed for loading a PDF page depends on the PDF physical size, BitsPerPixel and DPI.
In cases of large PDFs, you can load portions of the PDF (For example 20 pages each time). You can use RasterCodecs.Load() overload that enables you to load selected pages from the PDF and do the loading in loops.
If you have a lot of RAM and you don't want to load the PDF in portions, make your service 64-bit and increase the value of MaximumGlobalRasterImageMemory.
For an example on how to load the PDF in portions, see the following link:
http://support.leadtools.com/CS/forums/29161/ShowPost.aspx#42269
If you need more help, please let me know.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.