From f4e8637e2dafb71c0a9ca1e4fce9da3fd894ae84 Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 7 Aug 2004 14:04:25 +0000 Subject: [PATCH] * fixed rotated crop box handling. * fixed default font loading. --- pdf2swf/SWFOutputDev.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 99c5c1b..0f8b934 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -707,18 +707,25 @@ void SWFOutputDev::endType3Char(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; + int rot = doc->getPageRotate(1); laststate = state; msg(" startPage %d (%f,%f,%f,%f)\n", pageNum, crop_x1, crop_y1, crop_x2, crop_y2); + if(rot!=0) + msg(" page is rotated %d degrees\n", rot); + msg(" processing page %d", pageNum); /* 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; + + /*x1 = crop_x1; y1 = crop_y1; x2 = crop_x2; - y2 = crop_y2; + y2 = crop_y2;*/ + state->transform(crop_x1,crop_y1,&x1,&y1); + state->transform(crop_x2,crop_y2,&x2,&y2); if(x2getNumPages(); if (doc->isEncrypted()) { - /*ERROR: This pdf is encrypted, and disallows copying. - Due to the DMCA, paragraph 1201, (2) A-C, circumventing - a technological measure that efficively controls access to - a protected work is violating American law. - See www.eff.org for more information about DMCA issues. - */ if(!doc->okToCopy()) { printf("PDF disallows copying. Bailing out.\n"); exit(1); //bail out -- 1.7.10.4