Page 1 of 1

Cropping a pdf file doesn't change it's size

Posted: 2011-08-02T14:42:03-07:00
by handschigl
Hello,

I cropped a pdf file. That's the code:

Code: Select all

# identify 17.pdf
17.pdf PDF 595x842 595x842+0+0 DirectClass 16-bit 1.43341mb
# convert 17.pdf -crop 200x200+0+0 tmp.pdf
# identify tmp.pdf
tmp.pdf PDF 595x842 595x842+0+0 DirectClass 16-bit 1.43341mb
Opening the new file tmp.pdf shows that it worked, but the size 595x842 has not been changed.
So it's not possible to create a correct jpeg thumbnail of the cropped pdf file.
There is always white space above the real content. I guess, this happens because of the wrong size of the new file...

Re: Cropping a pdf file doesn't change it's size

Posted: 2011-08-02T15:19:01-07:00
by fmw42
the size of a vector pdf file is mostly controlled by its density. you may have to convert it to a pixel format and then crop it and then convert back to pdf. However, IM is not the best tool for going back and forth. I have never used this and don't really know what it does, but perhaps see -define pdf:use-cropbox=true in the link below. Or perhaps by using -page to set the virtual canvas. See the links below.

see
http://www.imagemagick.org/Usage/formats/#vector
http://www.imagemagick.org/Usage/formats/#ps
http://www.imagemagick.org/Usage/text/#postscript
http://www.imagemagick.org/Usage/basics/#page

Re: Cropping a pdf file doesn't change it's size

Posted: 2011-08-02T19:20:52-07:00
by anthony
Particularly the first link...

A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector