imagemagick - N PNG files to one PDF file: keep duplex information -


i converting n png files 1 pdf file. works great convert image magick:

convert front1.png back1.png front2.png back2.png result.pdf 

here simple ascii art illustrate this:

+-------------------+   +-------------------+          |                   |   |                   |          |                   |   |                   |          |     front-1       |   |     back-1        | |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          +-------------------+   +-------------------+              +-------------------+   +-------------------+          |                   |   |                   |          |                   |   |                   |          |     front-2       |   |     back-2        |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          +-------------------+   +-------------------+          

sometimes back-side missing, keep duplex information.

case1: first backside missing:

convert front1.png front2.png back2.png result.pdf 

if gets printed on duplex printer, result be:

+-------------------+   +-------------------+          |                   |   |                   |          |                   |   |                   |          |     front-1       |   |     front-2       |  |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          |                   |   |                   |          +-------------------+   +-------------------+              +-------------------+          |                   |          |                   |            |     back-2        |             |                   |         |                   |       |                   |     |                   |        |                   |    |                   |           |                   |           +-------------------+         

one simple work-around take empty page if don't back1.png. work-around, avoid.

how can keep duplex information in create pdf if back1.png missing?

in imagemagick can add new image desired putting white or other colored image in place want. if pages same or want match right side pages size of left in example, do:

unix syntax:

convert front1.png back1.png front2.png \( +clone -fill white -colorize 100 \) result.pdf 

windows syntax:

convert front1.png back1.png front2.png ( +clone -fill white -colorize 100 ) result.pdf 

if using imagemagick 7, replace convert magick.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -