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; }
72 XRef *xref; // the xref table for this PDF file
73 Page **pages; // array of pages
74 Ref *pageRefs; // object ID for each page
75 int numPages; // number of pages
76 int pagesSize; // size of pages array
77 Object dests; // named destination dictionary
78 Object nameTree; // name tree
79 GString *baseURI; // base URI for URI-type links
80 Object metadata; // metadata stream
81 Object structTreeRoot; // structure tree root dictionary
82 Object outline; // outline dictionary
83 GBool ok; // true if catalog is valid
85 int readPageTree(Dict *pages, PageAttrs *attrs, int start);
86 Object *findDestInTree(Object *tree, GString *name, Object *obj);