On Tue, 24 Nov 2009 04:14:10 +0100 Sebastian Krause <[email protected]> wrote:
| Anthony Thyssen <[email protected]> wrote: | > | * Only change the density in the image (don't actually resize it) so | > | that it actually represents and A4 sized page. | > | > [...] | > | > Best idea might be not to resize your JPG, but set the density | > (its real world measurements) so that it best fits an A4 page. | | That's exactly what I want to do, but my big question was how to let | convert do that automatically for me. :) | You would need to work out a formula. Hmmm lets first simplify in that the A4 is in portrait (which I believe is what page A4 means). and that regardless of the image it is the width that matters. You can force a image to be rotated into a portrait ratio, if nessary by using... -rotate 90\> A4 width is 8.27 inches. and your image is W pixels wide. The density is W/8.27 dpi (dots per inch). You can set density using -set whcih is one of the few IM v6 setting options that lets you use '%" escapes. That means Im can do the calculations! convert image.jpg -rotate 90\> -units PixelsPerInch \ -set density '%[fx:w/8.27]' -page A4 image.pdf This is not the final solution. you also need to pad the image to the right aspect ratio. For A4 you will want one dimention to be the sqrt(2) of the other. That is part of the definition of the 'A-series'! Anyone like to try this? Anthony Thyssen ( System Programmer ) <[email protected]> -------------------------------------------------------------------------- I was playing poker the other night... with Tarot cards. I got a full house and 4 people died. -- Steven Wright -------------------------------------------------------------------------- Anthony's Castle http://hobbit.ict.griffith.edu.au/~anthony/ _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
