X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FPDFDoc.h;h=c12531e9387c76bf7c89c9a8e146cb1e9e5500e8;hb=5ede6209244433ea174111a9079fa6d0cf84d227;hp=e679db9795edec920d234882c4ce902da48b732f;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/xpdf/PDFDoc.h b/pdf2swf/xpdf/PDFDoc.h index e679db9..c12531e 100644 --- a/pdf2swf/xpdf/PDFDoc.h +++ b/pdf2swf/xpdf/PDFDoc.h @@ -2,7 +2,7 @@ // // PDFDoc.h // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2002 Glyph & Cog, LLC // //======================================================================== @@ -14,13 +14,13 @@ #endif #include +#include "XRef.h" #include "Link.h" #include "Catalog.h" #include "Page.h" class GString; class BaseStream; -class XRef; class OutputDev; class Links; class LinkAction; @@ -33,16 +33,24 @@ class LinkDest; class PDFDoc { public: - PDFDoc(GString *fileName1, GString *userPassword = NULL); - PDFDoc(BaseStream *str, GString *userPassword = NULL); + PDFDoc(GString *fileNameA, GString *ownerPassword = NULL, + GString *userPassword = NULL, GBool printCommandsA = gFalse); + PDFDoc(BaseStream *strA, GString *ownerPassword = NULL, + GString *userPassword = NULL, GBool printCommandsA = gFalse); ~PDFDoc(); // Was PDF document successfully opened? GBool isOk() { return ok; } + // Get the error code (if isOk() returns false). + int getErrorCode() { return errCode; } + // Get file name. GString *getFileName() { return fileName; } + // Get the xref table. + XRef *getXRef() { return xref; } + // Get catalog. Catalog *getCatalog() { return catalog; } @@ -60,6 +68,13 @@ public: // Get number of pages. int getNumPages() { return catalog->getNumPages(); } + // Return the contents of the metadata stream, or NULL if there is + // no metadata. + GString *readMetadata() { return catalog->readMetadata(); } + + // Return the structure tree root object. + Object *getStructTreeRoot() { return catalog->getStructTreeRoot(); } + // Display a page. void displayPage(OutputDev *out, int page, double zoom, int rotate, GBool doLinks); @@ -88,10 +103,14 @@ public: GBool isEncrypted() { return xref->isEncrypted(); } // Check various permissions. - GBool okToPrint() { return xref->okToPrint(); } - GBool okToChange() { return xref->okToChange(); } - GBool okToCopy() { return xref->okToCopy(); } - GBool okToAddNotes() { return xref->okToAddNotes(); } + GBool okToPrint(GBool ignoreOwnerPW = gFalse) + { return xref->okToPrint(ignoreOwnerPW); } + GBool okToChange(GBool ignoreOwnerPW = gFalse) + { return xref->okToChange(ignoreOwnerPW); } + GBool okToCopy(GBool ignoreOwnerPW = gFalse) + { return xref->okToCopy(ignoreOwnerPW); } + GBool okToAddNotes(GBool ignoreOwnerPW = gFalse) + { return xref->okToAddNotes(ignoreOwnerPW); } // Is this document linearized? GBool isLinearized(); @@ -107,7 +126,7 @@ public: private: - GBool setup(GString *userPassword); + GBool setup(GString *ownerPassword, GString *userPassword); void checkHeader(); void getLinks(Page *page); @@ -118,8 +137,10 @@ private: XRef *xref; Catalog *catalog; Links *links; + GBool printCommands; GBool ok; + int errCode; }; #endif