1 //========================================================================
5 // Copyright 1996-2003 Glyph & Cog, LLC
7 //========================================================================
14 #ifdef USE_GCC_PRAGMAS
25 //------------------------------------------------------------------------
27 //------------------------------------------------------------------------
39 GBool isOk() { return ok; }
41 // Get number of pages.
42 int getNumPages() { return numPages; }
45 Page *getPage(int i) { return pages[i-1]; }
47 // Get the reference for a page object.
48 Ref *getPageRef(int i) { return &pageRefs[i-1]; }
50 // Return base URI, or NULL if none.
51 GString *getBaseURI() { return baseURI; }
53 // Return the contents of the metadata stream, or NULL if there is
55 GString *readMetadata();
57 // Return the structure tree root object.
58 Object *getStructTreeRoot() { return &structTreeRoot; }
60 // Find a page, given its object ID. Returns page number, or 0 if
62 int findPage(int num, int gen);
64 // Find a named destination. Returns the link destination, or
65 // NULL if <name> is not a destination.
66 LinkDest *findDest(GString *name);
68 Object *getOutline() { return &outline; }
70 Object *getAcroForm() { return &acroForm; }
74 XRef *xref; // the xref table for this PDF file
75 Page **pages; // array of pages
76 Ref *pageRefs; // object ID for each page
77 int numPages; // number of pages
78 int pagesSize; // size of pages array
79 Object dests; // named destination dictionary
80 Object nameTree; // name tree
81 GString *baseURI; // base URI for URI-type links
82 Object metadata; // metadata stream
83 Object structTreeRoot; // structure tree root dictionary
84 Object outline; // outline dictionary
85 Object acroForm; // AcroForm dictionary
86 GBool ok; // true if catalog is valid
88 int readPageTree(Dict *pages, PageAttrs *attrs, int start);
89 Object *findDestInTree(Object *tree, GString *name, Object *obj);