memory - Efficient thumbnail generation of huge pdf file? -


In a system I am working, we are generating thumbnails as part of the workflow. Sometimes PDF files are very large (print size 3M2) and may contain large bitmap images.

Is there a thumbnail generation of capable programs which are optimized for memory footprint such large PDF files

What do I use for all my CLI graphics, maybe it can work for you :

  Change foo.pdf foo-% png   

It produces three different PNG files:

 < Code> foo-0.png foo-1.png foo-2.png   

To create only one thumbnail, pdf Behave as if it is an array ( [0] is the first page, [1] is second, etc.):

  convert Foo.pdf [0] foo-thumb.png   

Since you are concerned about memory, with the -cache option, you use memory You can limit:

--Cash threshold Memory megabytes is available for pixel cache.

I mess pixels are stored in memory until thresholds megabytes memory is not used. Later pixel operations are cached on the disc. The operation of memory is quite fast, but if your computer does not have enough free memory, then you can adjust this threshold value.

Then thumbnail a PDF file and replace it again, you can use a maximum of 20 MB maximum memory to run this command:

  convert -cache 20 foo.pdf [0] -Resize 10% x10% foo-thumb.png   

or you use -density to specify the output density (900 scales are quite below):

  convert-cache 20 Foo.pdf [0] -density 900 foo-thumb.png    

Comments