2
//========================================================================
6
// Copyright 1996-2002 Glyph & Cog, LLC
8
//========================================================================
15
#ifdef USE_GCC_PRAGMAS
34
//------------------------------------------------------------------------
36
//------------------------------------------------------------------------
41
PDFDoc(GString *fileNameA, GString *ownerPassword = NULL,
42
GString *userPassword = NULL);
43
PDFDoc(BaseStream *strA, GString *ownerPassword = NULL,
44
GString *userPassword = NULL);
47
// Was PDF document successfully opened?
48
GBool isOk() { return ok; }
50
// Get the error code (if isOk() returns false).
51
int getErrorCode() { return errCode; }
54
GString *getFileName() { return fileName; }
56
// Get the xref table.
57
XRef *getXRef() { return xref; }
60
Catalog *getCatalog() { return catalog; }
63
BaseStream *getBaseStream() { return str; }
65
// Get page parameters.
66
double getPageWidth(int page)
67
{ return catalog->getPage(page)->getWidth(); }
68
double getPageHeight(int page)
69
{ return catalog->getPage(page)->getHeight(); }
70
int getPageRotate(int page)
71
{ return catalog->getPage(page)->getRotate(); }
73
// Get number of pages.
74
int getNumPages() { return catalog->getNumPages(); }
76
// Return the contents of the metadata stream, or NULL if there is
78
GString *readMetadata() { return catalog->readMetadata(); }
80
// Return the structure tree root object.
81
Object *getStructTreeRoot() { return catalog->getStructTreeRoot(); }
84
void displayPage(OutputDev *out, int page, double zoom,
85
int rotate, GBool doLinks,
86
GBool (*abortCheckCbk)(void *data) = NULL,
87
void *abortCheckCbkData = NULL);
89
// Display a range of pages.
90
void displayPages(OutputDev *out, int firstPage, int lastPage,
91
int zoom, int rotate, GBool doLinks,
92
GBool (*abortCheckCbk)(void *data) = NULL,
93
void *abortCheckCbkData = NULL);
95
// Display part of a page.
96
void displayPageSlice(OutputDev *out, int page, double zoom,
97
int rotate, int sliceX, int sliceY,
98
int sliceW, int sliceH,
99
GBool (*abortCheckCbk)(void *data) = NULL,
100
void *abortCheckCbkData = NULL);
102
// Find a page, given its object ID. Returns page number, or 0 if
104
int findPage(int num, int gen) { return catalog->findPage(num, gen); }
106
// If point <x>,<y> is in a link, return the associated action;
108
LinkAction *findLink(double x, double y) { return links->find(x, y); }
110
// Return true if <x>,<y> is in a link.
111
GBool onLink(double x, double y) { return links->onLink(x, y); }
113
// Find a named destination. Returns the link destination, or
114
// NULL if <name> is not a destination.
115
LinkDest *findDest(GString *name)
116
{ return catalog->findDest(name); }
118
#ifndef DISABLE_OUTLINE
119
// Return the outline object.
120
Outline *getOutline() { return outline; }
123
// Is the file encrypted?
124
GBool isEncrypted() { return xref->isEncrypted(); }
126
// Check various permissions.
127
GBool okToPrint(GBool ignoreOwnerPW = gFalse)
128
{ return xref->okToPrint(ignoreOwnerPW); }
129
GBool okToChange(GBool ignoreOwnerPW = gFalse)
130
{ return xref->okToChange(ignoreOwnerPW); }
131
GBool okToCopy(GBool ignoreOwnerPW = gFalse)
132
{ return xref->okToCopy(ignoreOwnerPW); }
133
GBool okToAddNotes(GBool ignoreOwnerPW = gFalse)
134
{ return xref->okToAddNotes(ignoreOwnerPW); }
136
// Is this document linearized?
137
GBool isLinearized();
139
// Return the document's Info dictionary (if any).
140
Object *getDocInfo(Object *obj) { return xref->getDocInfo(obj); }
141
Object *getDocInfoNF(Object *obj) { return xref->getDocInfoNF(obj); }
143
// Return the PDF version specified by the file.
144
double getPDFVersion() { return pdfVersion; }
146
// Save this file with another name.
147
GBool saveAs(GString *name);
152
GBool setup(GString *ownerPassword, GString *userPassword);
154
void getLinks(Page *page);
163
#ifndef DISABLE_OUTLINE