1
//========================================================================
5
// Copyright 1996-2007 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 *getDests() { return &dests; }
70
Object *getNameTree() { return &nameTree; }
72
Object *getOutline() { return &outline; }
74
Object *getAcroForm() { return &acroForm; }
78
XRef *xref; // the xref table for this PDF file
79
Page **pages; // array of pages
80
Ref *pageRefs; // object ID for each page
81
int numPages; // number of pages
82
int pagesSize; // size of pages array
83
Object dests; // named destination dictionary
84
Object nameTree; // name tree
85
GString *baseURI; // base URI for URI-type links
86
Object metadata; // metadata stream
87
Object structTreeRoot; // structure tree root dictionary
88
Object outline; // outline dictionary
89
Object acroForm; // AcroForm dictionary
90
GBool ok; // true if catalog is valid
92
int readPageTree(Dict *pages, PageAttrs *attrs, int start,
94
Object *findDestInTree(Object *tree, GString *name, Object *obj);