--- poppler-git-1dec12/poppler/OutputDev.h- 2012-12-01 19:34:15.718699834 -0500 +++ poppler-git-1dec12/poppler/OutputDev.h 2012-12-01 20:44:49.485690736 -0500 @@ -112,6 +112,9 @@ // non-shown layers? virtual GBool needCharCount() { return gFalse; } + // Does this device need to clip pages to the crop box? + virtual GBool needClipToCropBox() { return gFalse; } + //----- initialization and control // Set default transform matrix. --- poppler-git-1dec12/poppler/PSOutputDev.cc- 2012-12-01 19:34:15.719699841 -0500 +++ poppler-git-1dec12/poppler/PSOutputDev.cc 2012-12-01 20:08:05.421852090 -0500 @@ -1053,6 +1053,7 @@ char *psTitle, int firstPage, int lastPage, PSOutMode modeA, int paperWidthA, int paperHeightA, GBool duplexA, + GBool clipToCropBoxA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, GBool forceRasterizeA, GBool manualCtrlA, @@ -1115,7 +1116,7 @@ init(outputToFile, f, fileTypeA, psTitle, doc, firstPage, lastPage, modeA, imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA, - paperWidthA, paperHeightA, duplexA); + paperWidthA, paperHeightA, duplexA, clipToCropBoxA); } PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, @@ -1123,6 +1124,7 @@ PDFDoc *doc, int firstPage, int lastPage, PSOutMode modeA, int paperWidthA, int paperHeightA, GBool duplexA, + GBool clipToCropBoxA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, GBool forceRasterizeA, GBool manualCtrlA, @@ -1153,7 +1155,7 @@ init(outputFuncA, outputStreamA, psGeneric, psTitle, doc, firstPage, lastPage, modeA, imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA, - paperWidthA, paperHeightA, duplexA); + paperWidthA, paperHeightA, duplexA, clipToCropBoxA); } void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, @@ -1161,7 +1163,7 @@ int firstPage, int lastPage, PSOutMode modeA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, GBool manualCtrlA, int paperWidthA, int paperHeightA, - GBool duplexA) { + GBool duplexA, GBool clipToCropBoxA) { Catalog *catalog; PDFRectangle *box; PSOutPaperSize *size; @@ -1179,6 +1181,7 @@ catalog = doc->getCatalog(); level = globalParams->getPSLevel(); mode = modeA; + clipToCropBox = clipToCropBoxA; paperWidth = paperWidthA; paperHeight = paperHeightA; imgLLX = imgLLXA; --- poppler-git-1dec12/poppler/PSOutputDev.h- 2012-12-01 19:34:15.719699841 -0500 +++ poppler-git-1dec12/poppler/PSOutputDev.h 2012-12-01 20:09:46.825467429 -0500 @@ -97,6 +97,7 @@ int firstPage, int lastPage, PSOutMode modeA, int paperWidthA = -1, int paperHeightA = -1, GBool duplexA = gTrue, + GBool clipToCropBoxA = gFalse, int imgLLXA = 0, int imgLLYA = 0, int imgURXA = 0, int imgURYA = 0, GBool forceRasterizeA = gFalse, @@ -111,6 +112,7 @@ int firstPage, int lastPage, PSOutMode modeA, int paperWidthA = -1, int paperHeightA = -1, GBool duplexA = gTrue, + GBool clipToCropBoxA = gFalse, int imgLLXA = 0, int imgLLYA = 0, int imgURXA = 0, int imgURYA = 0, GBool forceRasterizeA = gFalse, @@ -152,6 +154,9 @@ // text in Type 3 fonts will be drawn with drawChar/drawString. virtual GBool interpretType3Chars() { return gFalse; } + // Does this device need to clip pages to the crop box? + virtual GBool needClipToCropBox() { return clipToCropBox; } + //----- header/trailer (used only if manualCtrl is true) // Write the document-level header. @@ -309,7 +314,7 @@ int firstPage, int lastPage, PSOutMode modeA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, GBool manualCtrlA, int paperWidthA, int paperHeightA, - GBool duplexA); + GBool duplexA, GBool clipToCropBoxA); void setupResources(Dict *resDict); void setupFonts(Dict *resDict); void setupFont(GfxFont *font, Dict *parentResDict); @@ -481,6 +486,7 @@ GBool t3NeedsRestore; // set if a 'q' operator was issued GBool forceRasterize; // forces the page to be rasterized into a image before printing GBool displayText; // displayText + GBool clipToCropBox; // clip pages to the crop box #if OPI_SUPPORT int opi13Nest; // nesting level of OPI 1.3 objects --- poppler-git-1dec12/poppler/Page.cc- 2012-12-01 19:34:15.720699848 -0500 +++ poppler-git-1dec12/poppler/Page.cc 2012-12-01 20:15:02.055919894 -0500 @@ -482,7 +482,8 @@ } gfx = new Gfx(doc, out, num, attrs->getResourceDict(), - hDPI, vDPI, &box, crop ? cropBox : (PDFRectangle *)NULL, + hDPI, vDPI, &box, + (crop || out->needClipToCropBox()) ? cropBox : (PDFRectangle *)NULL, rotate, abortCheckCbk, abortCheckCbkData); return gfx; --- poppler-git-1dec12/utils/pdftops.cc- 2012-12-01 19:34:15.736699958 -0500 +++ poppler-git-1dec12/utils/pdftops.cc 2012-12-01 20:11:12.554994163 -0500 @@ -392,7 +392,8 @@ NULL, firstPage, lastPage, mode, paperWidth, paperHeight, - duplex); + duplex, + doEPS && !noCrop); if (psOut->isOk()) { doc->displayPages(psOut, firstPage, lastPage, 72, 72, 0, noCrop, !noCrop, gTrue);