[poppler] Add trimbox support to pdftops

Benjamin Adler benadler at gmx.net
Mon Oct 18 08:29:23 PDT 2010


Dear popplers,

I'd like to convert PDFs with high-res images and crop-marks to 
lower-res PDFs where the page-area outside of the cropping regions is 
white (no more cropmarks etc. visible). The cropping region is saved in 
the PDF as a TrimBox value (not CropBox or MediaBox).

To do this, I want to convert the PDFs using poppler's pdftops and crop 
them in that process. Lateron, I'll add some white border around the PDF 
(maybe embedding it with latex/pdfpages, not sure yet).

Instead of the -nocrop switch, I imagine sth. like

	pdftops -crop [TrimBox|...|CropBox] in.pdf out.ps

As of now, poppler's pdftopsd only supports CropBox, not ArtBox, TrimBox 
or MediaBox. Looking at the source, it seems some parts of poppler have 
heard of these boxes before, some have not.

Whats the best way to patch this into poppler? I would have changed the 
signatures of Page::display and Page::displaySlice, Page::createGfx and 
  PDFDoc::displayPage* so that I can pass one value of the page_box_enum 
defined in poppler-global.h

- How would you do it?

- Why does Gfx's c'tor take both PDFRectangle *box and PDFRectangle 
*cropBox?

thanks!
ben


More information about the poppler mailing list