sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.38k stars 1.7k forks source link

Viewing PDF media box marks #814

Open dirq opened 7 years ago

dirq commented 7 years ago

I use Sumatra for PDF development as it doesn't lock files like Adobe Reader and it automatically refreshes when the PDF file is updated.

It would be great if I could turn on the ability to see the different box marks for:

GitHubRulesOK commented 1 year ago

Hmm they are often not present so currently SumatraPDF will only show the /MediaBox such as /MediaBox [0 0 594.95996 841.91998] the visible a4 page boundary and respect the /CropBox if present and smaller as the visible content

When present any marks outside the page are not shown but if inside the page then marks will be shown. Here is a sample /CropBox[85.0394 109.134 510.241 732.756]/MediaBox[0 0 595.28 841.89]/TrimBox[113.386 137.48 481.894 704.41]
image

Page is declared as 425.2 x 623.6 pt thus visible = the crop box = roughly 510-85 x 733-109 =15 cm x 22 cm which is what SumatraPDF displays as contents. Knowing there is a voidless media outside all 4 sides is not useful to a reader the real trim box is defined by the Trim marks showing at approx. 28 points inside the crop box as can be seen from 113.39-85.04 etc. but that's not related to the image trim which is 2172 wide, looks like its 312.77 0 0 516.1 141.25 162.9 cm =11 cm wide posibly at 500 ppi so showing all that clutter is no real help to a reader.

Every single page can be different so for a book of 330 pages thats a lot of less usefull info

If you need to see the real dimensions in a long listing (optionally per page), then simplest is run pdfinfo -box filename.pdf to get a list of the PDF properties and the offsets and dimensions of the MediaBox, CropBox, BleedBox, TrimBox and ArtBox.

Print Media Box is usually largest > Crop Box =Viewer/Printer Display > Printed Trim area inside Gripper Box but normally can = Crop Box thus Bleed box = Between Media & Crop the Image/Body text Area may be considered as the ArtBox its undeclared in this case but clearly is inside the Trim Box

kjk commented 1 year ago

Please attach a test, single page PDF which has all those things (of different values) so that I can test something like this.

GitHubRulesOK commented 1 year ago

@kjk that sample with 3 boxes and problematic image was/is at https://github.com/sumatrapdfreader/sumatrapdf/issues/1480 there is no art box as such, but for some users the image boundary would be the equivalent, unless an /ArtBox was specified at a larger area to allow for bleed around it, there are many ways of considering /BBoxes that are not as strictly defined per Adobe ISO so simplest is only show those included and tagged as such. object may be present outside all boxes as often is seen by read aloud jumping out of the visible box.