[gs-bugs] [Bug 691145] New: Trimbox not being cropped properly

bugs.ghostscript.com-bugzilla-daemon at ghostscript.com bugs.ghostscript.com-bugzilla-daemon at ghostscript.com
Fri Feb 26 13:33:53 UTC 2010


           Summary: Trimbox not being cropped properly
           Product: Ghostscript
           Version: 8.71
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P4
         Component: PDF Interpreter
        AssignedTo: alex.cherepanov at artifex.com
        ReportedBy: raine.ekman at damex.fi
         QAContact: gs-bugs at ghostscript.com

$ grep -a Box problem.pdf |grep -v FontBBox
/TrimBox [28.3297 29.0042 624.602 870.126]
/MediaBox [0.0 0.0 841.89 595.276]
/CropBox [0.0 0.0 841.89 595.276]
/BleedBox [28.3297 29.0042 624.602 870.126]

$ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -dTextAlphaBits=4 
-dGraphicsAlphaBits=4 -dMaxStripSize=8192 -sOutputFile=problem.jpg problem.pdf 
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1

$ identify problem.jpg 
problem.jpg JPEG 1754x1240 1754x1240+0+0 8-bit DirectClass 224KB 0.000u 0:00.000

$ gs -dUseTrimBox -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -
dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dMaxStripSize=8192 -
sOutputFile=problem.jpg problem.pdf 

$ identify problem.jpg 
problem.jpg JPEG 1242x1752 1242x1752+0+0 8-bit DirectClass 135KB 0.000u 0:00.000

This seems to be the entire TrimBox with quite a bit of empty space from 
outside the MediaBox.

Shouldn't the second result really be an intersection of the MediaBox and the 
TrimBox, as the PDF reference, version 1.7, section 10.10 states:
"The crop, bleed, trim, and art boxes should not ordinarily extend beyond the 
boundaries of the media box. If they do, they are effectively reduced to their 
intersection with the media box."

------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the gs-bugs mailing list