X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FPage.h;h=36f96e1ad6027d8d71079db72aeaefd124b3b4e1;hb=85c46a8011c7fd5e4bda282266006c972ea7606b;hp=2376cb496bae7aced45b98be6d5d7777bf007dbd;hpb=c7432833fe3a6469d63fad135151a92e12877b94;p=swftools.git diff --git a/pdf2swf/xpdf/Page.h b/pdf2swf/xpdf/Page.h index 2376cb4..36f96e1 100644 --- a/pdf2swf/xpdf/Page.h +++ b/pdf2swf/xpdf/Page.h @@ -51,7 +51,6 @@ public: ~PageAttrs(); // Accessors. - PDFRectangle *getBox() { return limitToCropBox ? &cropBox : &mediaBox; } PDFRectangle *getMediaBox() { return &mediaBox; } PDFRectangle *getCropBox() { return &cropBox; } GBool isCropped() { return haveCropBox; } @@ -83,7 +82,6 @@ private: PDFRectangle mediaBox; PDFRectangle cropBox; GBool haveCropBox; - GBool limitToCropBox; PDFRectangle bleedBox; PDFRectangle trimBox; PDFRectangle artBox; @@ -114,12 +112,17 @@ public: GBool isOk() { return ok; } // Get page parameters. - PDFRectangle *getBox() { return attrs->getBox(); } PDFRectangle *getMediaBox() { return attrs->getMediaBox(); } PDFRectangle *getCropBox() { return attrs->getCropBox(); } GBool isCropped() { return attrs->isCropped(); } - double getWidth() { return attrs->getBox()->x2 - attrs->getBox()->x1; } - double getHeight() { return attrs->getBox()->y2 - attrs->getBox()->y1; } + double getMediaWidth() + { return attrs->getMediaBox()->x2 - attrs->getMediaBox()->x1; } + double getMediaHeight() + { return attrs->getMediaBox()->y2 - attrs->getMediaBox()->y1; } + double getCropWidth() + { return attrs->getCropBox()->x2 - attrs->getCropBox()->x1; } + double getCropHeight() + { return attrs->getCropBox()->y2 - attrs->getCropBox()->y1; } PDFRectangle *getBleedBox() { return attrs->getBleedBox(); } PDFRectangle *getTrimBox() { return attrs->getTrimBox(); } PDFRectangle *getArtBox() { return attrs->getArtBox(); } @@ -142,19 +145,23 @@ public: // Display a page. void display(OutputDev *out, double hDPI, double vDPI, - int rotate, GBool crop, + int rotate, GBool useMediaBox, GBool crop, Links *links, Catalog *catalog, GBool (*abortCheckCbk)(void *data) = NULL, void *abortCheckCbkData = NULL); // Display part of a page. void displaySlice(OutputDev *out, double hDPI, double vDPI, - int rotate, GBool crop, + int rotate, GBool useMediaBox, GBool crop, int sliceX, int sliceY, int sliceW, int sliceH, Links *links, Catalog *catalog, GBool (*abortCheckCbk)(void *data) = NULL, void *abortCheckCbkData = NULL); + // Get the page's default CTM. + void getDefaultCTM(double *ctm, double hDPI, double vDPI, + int rotate, GBool upsideDown); + private: XRef *xref; // the xref table for this PDF file