Converting from jpg or tif to pdf: size of the pdf
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Converting from jpg or tif to pdf: size of the pdf
How can I change the size (in cm or in) of the pdf without changing the resolution? Of course -resize change this size but it also changes the resolution.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting from jpg or tif to pdf: size of the pdf
What do you mean by resolution? If you have a PDF, it is a vector file with no defined resolution. You have to use -density before reading the pdf to change the resolution for converting to raster or for printing. Please clarify your question.
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Converting from jpg or tif to pdf: size of the pdf
"-density" will change the physical size (in inches or centimetres) of the PDF without changing the pixels. Eg:
Does that answer the question?
Code: Select all
convert rose: -density 300 out.pdf
snibgo's IM pages: im.snibgo.com
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Re: Converting from jpg or tif to pdf: size of the pdf
Yes it does. With Acrobat Reader, Document properties, I see the document size decrease when the density increases. But I have to try a density at random and calculate the ratio present size/desired size and adapt the new density to it.snibgo wrote: ↑2017-02-26T09:51:51-07:00 "-density" will change the physical size (in inches or centimetres) of the PDF without changing the pixels. Eg:Does that answer the question?Code: Select all
convert rose: -density 300 out.pdf
Can't I specify the new desired size directly?
Which command line can give me my IM version?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Converting from jpg or tif to pdf: size of the pdf
"convert -version" will output the version information.
In v6, "-density" needs a number. You can calculate that in a shell script.
In v7, "-density" can use a calculation. For example:
This will make the PDF 2 inches wide.
In v6, "-density" needs a number. You can calculate that in a shell script.
In v7, "-density" can use a calculation. For example:
Code: Select all
magick in.png -density %[fx:w/2] out.pdf
snibgo's IM pages: im.snibgo.com
-
- Posts: 41
- Joined: 2016-10-04T02:08:22-07:00
- Authentication code: 1151
- Location: Nice, France
Re: Converting from jpg or tif to pdf: size of the pdf
Works fine, thanks.snibgo wrote: ↑2017-02-26T13:06:43-07:00 In v7, "-density" can use a calculation. For example:This will make the PDF 2 inches wide.Code: Select all
magick in.png -density %[fx:w/2] out.pdf