creating large pdf or postscript files

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

creating large pdf or postscript files

Post by troyd1 »

I want to create a 60,000 image multipage postscript or pdf file from png graphics. To test, I put 1,000 of them into a directory and then did "convert *.png multi.pdf or ps" both use up 2 gigs of memory and then abort. Is there a way to handle this. What I am trying to accomplish is to create a large sequential print file for a printer to print. The printer that I am working with can handle either of these formats. I tested with a few graphics and it works perfect. I believe it is trying to hold everything in memory and then writing it out instead of doing it incrementally.

Thanks in advance for any help, Troy
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: creating large pdf or postscript files

Post by fmw42 »

troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

Re: creating large pdf or postscript files

Post by troyd1 »

Thanks. I have the q16 version, and don;t think the q8 version will make a difference.

I saw this which is a way to limit memory:

env MAGICK_TMPDIR=/data nice -5 \
convert -limit memory 32 -limit map 32 \
huge_9Gb_file.psd -scene 1 +adjoin layer_%d.png

I tried a simple: convert -limit area 1000mb *.png mult.pdf

I keep getting an error that says: convert: invalid argument for option 1000mb: -limit.

What am I doing wrong? I have about 2 gig of memory to work with and 1tb of hard disk space. I am on a windows machine.
Also, where will it use temp if there is not an environmental variable set?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: creating large pdf or postscript files

Post by fmw42 »

Sorry I am not a Windows user and have not really experimented with those arguments. So you will need expert help from Magick or Anthony or some one with more experience than I.
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

Re: creating large pdf or postscript files

Post by troyd1 »

Thanks for your help anyway. I have found that I can do convert -limit memory 500 -limit map 500 *.png *.pdf and it does not run out of memory. I have 8 gig of memory and it still crashes at 2 gig if I don't do the -limit. Is there a reason for this and is there a way to use all 8 gig's? I was thinking a solution for me would be to buy more memory as my machine will hold more, but it will not be of value if the program does not use it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: creating large pdf or postscript files

Post by magick »

Are you using the 64-bit version of ImageMagick? If not, try it. It should be able to exceed the 2GB 32-bit Windows limit.
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

Re: creating large pdf or postscript files

Post by troyd1 »

can you use a 64 bit version on a 32 bit os?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: creating large pdf or postscript files

Post by magick »

No you need a 64-bit OS. Windows 32-bit has a limit of 3GB address space and in general a process gets less than that when requesting memory.
Post Reply