PDF Trimbox

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick uses the media box by default. If you use the -define pdf:use-cropbox=true option, ImageMagick uses the crop box. However, we currently have no option to use the trim box. Post a URL to your image here and we will get a patch in ImageMagick 6.2.7-2 Beta to use the trim box.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

An example PDF image with a trim box is needed to test our patch.
whirled

Re: PDF Trimbox

Post by whirled »

Hi,

I was wondering if the ability to use the trimbox rather than the cropbox has been added to IM yet...
I am creating high resolution PDFs with bleed, and then generating low resolution GIFs with IM. However, I would like to view the bleed within the PDF, but not in the GIF. Using cropbox hides the bleed in Adobe Reader.

I also tried using -crop to try to cut the bleed out of the GIF, which works fine as long as the image is not scaled at all. If the image is scaled, IM does not crop the image properly. I tried changing the order of the commands, and still could not achieve the desired result.

I used +repage, which makes the image the proper size, but still does not crop the correct portion. Below is an example of the command I used.

Code: Select all

convert -density 155 -profile "USWebCoatedSWOP.icc" pdf:- -crop 252x144+4+4 +repage -profile "sRGB Color Space Profile.icm" -strip -resize 200% -resample 72 gif:-[-1]
I am using stdin and stdout for input and output, respectively.

Any help with this matter would be greatly appreciated.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PDF Trimbox

Post by magick »

Try adding -define pdf:use-trimbox=true to your command line to size the image as defined by the PDF TrimBox geometry.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF Trimbox

Post by anthony »

Added the above to IM Examples, PDF format notes.
http://imagemagick.org/Usage/formats/#pdf

may take a day or two to appear.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
theorysavage

Re: PDF Trimbox

Post by theorysavage »

when I use -define pdf:use-trimbox=true, I get the correct trimbox dimensions but not the right location, as if the trimbox had been pushed to the bottom left corner of the page.

Is there a way to fix this?
I have examples images if this is not clear.
bowa

Re: PDF Trimbox

Post by bowa »

yep i am having the same problem ...
Post Reply