Error while creating pdf file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
and
Posts: 5
Joined: 2017-08-06T23:15:17-07:00
Authentication code: 1151

Error while creating pdf file

Post by and »

Hi!

We noticed a strange feature. When creating the PDF with the command:
convert *.jpeg 1.pdf

There is always an error:
Convert: Insufficient memory (case 4) `C: / Users / VE~ 1 / AppData / Local / Temp / magi
Ck-7696PFc_35Mafooz-7 '@ error / jpeg.c / JPEGErrorHandler / 331.

Number of files 97. The memory they occupy is 40.4MB.

Pressed the file size to 80%. The error did not go away.
Pressed the file size to 1%. PDF file was successfully created.

How to fix the situation? Because 97 images it's not even a maximum. In the future, we want to convert up to 400 images into one PDF file.

We use IM: 7.0.6-4;
Windows 7 x64. SP1.
RAM: 8 and 64Gb. We test on both PC.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Error while creating pdf file

Post by snibgo »

and wrote:Number of files 97. The memory they occupy is 40.4MB.
I suspect the disk they occupy is 40.4MB, but far more memory. How many pixels? V6 needs 8 bytes memory per pixel. I don't know how much v7 needs.
and wrote:Pressed the file size to 1%.
What does that mean? What command did you use?
snibgo's IM pages: im.snibgo.com
and
Posts: 5
Joined: 2017-08-06T23:15:17-07:00
Authentication code: 1151

Re: Error while creating pdf file

Post by and »

1. Image resolution 2528x3513.
2. I apologize for the ambiguity. Compression up to 1% means, that image resolution became 25x35. Dimension compression did by "FastStone Image Viewer".

Apparently the envelope process really rests on a memory limit. But how can you get out of this situation, if you do not change the resolution of the pictures? And could you give an example of calculating memory so that we can evaluate the capabilities of the envelope program.
"FastStone Image Viewer" converts this set of images without errors.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Error while creating pdf file

Post by snibgo »

2528x3513x97 = 861 million pixels. At 8 bytes per pixel, this needs 6.9 GB memory. This is memory needed to read the images, before any processing.

Doing the entire job in one IM command needs lots of memory. An alternative is to create one pdf per input image, or one pdf per batch of ten input images, and combine the pdfs with a tool such as pdfunite.
snibgo's IM pages: im.snibgo.com
and
Posts: 5
Joined: 2017-08-06T23:15:17-07:00
Authentication code: 1151

Re: Error while creating pdf file

Post by and »

Thank you very much for your explanations and practical advice.
The pdfunite works fine.
Post Reply