1 //========================================================================
5 // Copyright 1996-2002 Glyph & Cog, LLC
7 //========================================================================
23 //------------------------------------------------------------------------
25 //------------------------------------------------------------------------
31 Catalog(XRef *xrefA, GBool printCommands = gFalse);
37 GBool isOk() { return ok; }
39 // Get number of pages.
40 int getNumPages() { return numPages; }
43 Page *getPage(int i) { return pages[i-1]; }
45 // Get the reference for a page object.
46 Ref *getPageRef(int i) { return &pageRefs[i-1]; }
48 // Return base URI, or NULL if none.
49 GString *getBaseURI() { return baseURI; }
51 // Return the contents of the metadata stream, or NULL if there is
53 GString *readMetadata();
55 // Return the structure tree root object.
56 Object *getStructTreeRoot() { return &structTreeRoot; }
58 // Find a page, given its object ID. Returns page number, or 0 if
60 int findPage(int num, int gen);
62 // Find a named destination. Returns the link destination, or
63 // NULL if <name> is not a destination.
64 LinkDest *findDest(GString *name);
68 XRef *xref; // the xref table for this PDF file
69 Page **pages; // array of pages
70 Ref *pageRefs; // object ID for each page
71 int numPages; // number of pages
72 int pagesSize; // size of pages array
73 Object dests; // named destination dictionary
74 Object nameTree; // name tree
75 GString *baseURI; // base URI for URI-type links
76 Object metadata; // metadata stream
77 Object structTreeRoot; // structure tree root dictionary
78 GBool ok; // true if catalog is valid
80 int readPageTree(Dict *pages, PageAttrs *attrs, int start,
82 Object *findDestInTree(Object *tree, GString *name, Object *obj);