From 9a82ed9f9c7189bc59a84a1326dc4a7e9d06ee0e Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 5 Jul 2004 11:00:28 +0000 Subject: [PATCH] fixed crop box passing. --- pdf2swf/SWFOutputDev.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index da2899f..db114bc 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -144,7 +144,7 @@ public: void startDoc(XRef *xref); // Start a page. - virtual void startPage(int pageNum, GfxState *state) ; + virtual void startPage(int pageNum, GfxState *state, double x1, double y1, double x2, double y2) ; //----- link borders virtual void drawLink(Link *link, Catalog *catalog) ; @@ -700,21 +700,28 @@ void SWFOutputDev::endType3Char(GfxState *state) msg(" endType3Char"); } -void SWFOutputDev::startPage(int pageNum, GfxState *state) +void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) { double x1,y1,x2,y2; laststate = state; - msg(" startPage %d\n", pageNum); + msg(" startPage %d (%f,%f,%f,%f)\n", pageNum, crop_x1, crop_y1, crop_x2, crop_y2); msg(" processing page %d", pageNum); - state->transform(state->getX1(),state->getY1(),&x1,&y1); + /* state->transform(state->getX1(),state->getY1(),&x1,&y1); state->transform(state->getX2(),state->getY2(),&x2,&y2); + Use CropBox, not MediaBox, as page size + */ + x1 = crop_x1; + y1 = crop_y1; + x2 = crop_x2; + y2 = crop_y2; + if(x2 Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2); - swfoutput_init(&output, swffilename,(int)x1,(int)y1,(int)y2,(int)y2); + swfoutput_init(&output, swffilename,(int)x1,(int)y1,(int)x2,(int)y2); outputstarted = 1; } else -- 1.7.10.4