![]() |
wxPdfDocument
1.4.0
Library for generating PDF documents from wxWidgets applications
|
Class representing a PDF parser. (For internal use only). More...
#include <pdfparser.h>
Public Member Functions | |
| wxPdfParser (const wxString &filename, const wxString &password=wxEmptyString) | |
| Constructor. | |
| virtual | ~wxPdfParser () |
| Destructor. | |
| bool | IsOk () const |
| Check whether the PDF document to be parsed is valid. | |
| wxString | GetPdfVersion () const |
| Get PDF version of parsed document. | |
| unsigned int | GetPageCount () const |
| Get number of pages in the parsed document. | |
| bool | GetSourceInfo (wxPdfInfo &info) |
| Get the document information dictionary. | |
| wxPdfObjectQueue * | GetObjectQueue () |
| Get the queue of referenced objects. | |
| wxPdfObjectMap * | GetObjectMap () |
| Get the map of referenced objects. | |
| void | AppendObject (int originalObjectId, int actualObjectId, wxPdfObject *obj) |
| Append a referenced object to the queue. | |
| wxPdfObject * | GetPageResources (unsigned int pageno) |
| Get the resources of a specific page. | |
| void | GetContent (unsigned int pageno, wxArrayPtrVoid &contents) |
| Get the content stream collection of a specific page. | |
| wxPdfArrayDouble * | GetPageMediaBox (unsigned int pageno) |
| Get the media box of a specific page. | |
| wxPdfArrayDouble * | GetPageCropBox (unsigned int pageno) |
| Get the crop box of a specific page. | |
| wxPdfArrayDouble * | GetPageBleedBox (unsigned int pageno) |
| Get the bleed box of a specific page. | |
| wxPdfArrayDouble * | GetPageTrimBox (unsigned int pageno) |
| Get the trim box of a specific page. | |
| wxPdfArrayDouble * | GetPageArtBox (unsigned int pageno) |
| Get the art box of a specific page. | |
| int | GetPageRotation (unsigned int pageno) |
| Get the rotation of a specific page. | |
| wxPdfObject * | ResolveObject (wxPdfObject *obj) |
| Resolve an object. | |
| void | SetUseRawStream (bool useRawStream) |
| Set flag whether a stream should be decoded or not. | |
| bool | GetUseRawStream () const |
| Get flag whether a stream should be decoded or not. | |
Protected Member Functions | |
| wxPdfObject * | GetPageResources (wxPdfObject *page) |
| Get the resources of a specific page identified by a page object. | |
| void | GetPageContent (wxPdfObject *contentRef, wxArrayPtrVoid &contents) |
| Get the content stream collection of a specific page. | |
| wxPdfArrayDouble * | GetPageBox (wxPdfDictionary *page, const wxString &boxIndex) |
| Get a page box. | |
| int | GetPageRotation (wxPdfDictionary *page) |
| Get a page rotation. | |
| bool | ParseDocument () |
| Parse PDF document. | |
| bool | SetupDecryptor () |
| Setup a decryptor. | |
| bool | ParseXRef () |
| Parse the cross reference. | |
| bool | ParsePageTree (wxPdfDictionary *pages) |
| Parse the page tree of the PDF document. | |
| wxPdfDictionary * | ParseXRefSection () |
| Parse a cross reference section. | |
| bool | ParseXRefStream (int ptr, bool setTrailer) |
| Parse a cross reference stream. | |
| wxPdfObject * | ParseObject () |
| Parse an object. | |
| wxPdfDictionary * | ParseDictionary () |
| Parse a dictionary. | |
| wxPdfArray * | ParseArray () |
| Parse an array. | |
| wxPdfObject * | ParseSpecificObject (int idx) |
| Parse a specific object. | |
| wxPdfObject * | ParseDirectObject (int k) |
| Parse a direct object. | |
| wxPdfObject * | ParseObjectStream (wxPdfStream *stream, int idx) |
| Parse an object from an object stream. | |
| void | GetStreamBytes (wxPdfStream *stream) |
| Parse the content of a stream object. | |
| void | GetStreamBytesRaw (wxPdfStream *stream) |
| Parse the raw content of a stream object. | |
| wxMemoryOutputStream * | DecodePredictor (wxMemoryOutputStream *in, wxPdfObject *dicPar) |
| Decode a stream predictor. | |
| wxMemoryOutputStream * | FlateDecode (wxMemoryOutputStream *osIn) |
| Decode a stream that has the FlateDecode filter. | |
| wxMemoryOutputStream * | ASCIIHexDecode (wxMemoryOutputStream *osIn) |
| Decode a stream that has the ASCIIHexDecode filter. | |
| wxMemoryOutputStream * | ASCII85Decode (wxMemoryOutputStream *osIn) |
| Decode a stream that has the ASCII85Decode filter. | |
| wxMemoryOutputStream * | LZWDecode (wxMemoryOutputStream *osIn) |
| Decode a stream that has the ASCII85Decode filter. | |
Static Protected Member Functions | |
| static wxFileSystem * | GetFileSystem () |
| Get wxWidgets file system. | |
Class representing a PDF parser. (For internal use only).
The parser uses a tokenizer to read the PDF file, identifies all indirect objects via the cross-reference (XRef) table, and provides methods to access page-specific resources and content streams.
| wxPdfParser::wxPdfParser | ( | const wxString & | filename, |
| const wxString & | password = wxEmptyString ) |
Constructor.
| filename | The name of the PDF file to parse |
| password | The password for encrypted documents |
|
virtual |
Destructor.
| void wxPdfParser::AppendObject | ( | int | originalObjectId, |
| int | actualObjectId, | ||
| wxPdfObject * | obj ) |
Append a referenced object to the queue.
| originalObjectId | The original ID in the source file |
| actualObjectId | The new ID in the destination document |
| obj | The PDF object |
|
protected |
Decode a stream that has the ASCII85Decode filter.
| osIn | the input data |
|
protected |
Decode a stream that has the ASCIIHexDecode filter.
| osIn | the input data |
|
protected |
Decode a stream predictor.
|
protected |
Decode a stream that has the FlateDecode filter.
| osIn | the input data |
| void wxPdfParser::GetContent | ( | unsigned int | pageno, |
| wxArrayPtrVoid & | contents ) |
Get the content stream collection of a specific page.
| pageno | The page number (1-based) | |
| [out] | contents | Array to be filled with content stream objects |
|
staticprotected |
Get wxWidgets file system.
|
inline |
Get the map of referenced objects.
|
inline |
Get the queue of referenced objects.
| wxPdfArrayDouble * wxPdfParser::GetPageArtBox | ( | unsigned int | pageno | ) |
Get the art box of a specific page.
| pageno | The page number (1-based) |
| wxPdfArrayDouble * wxPdfParser::GetPageBleedBox | ( | unsigned int | pageno | ) |
Get the bleed box of a specific page.
| pageno | The page number (1-based) |
|
protected |
Get a page box.
|
protected |
Get the content stream collection of a specific page.
| unsigned int wxPdfParser::GetPageCount | ( | ) | const |
Get number of pages in the parsed document.
| wxPdfArrayDouble * wxPdfParser::GetPageCropBox | ( | unsigned int | pageno | ) |
Get the crop box of a specific page.
| pageno | The page number (1-based) |
| wxPdfArrayDouble * wxPdfParser::GetPageMediaBox | ( | unsigned int | pageno | ) |
Get the media box of a specific page.
| pageno | The page number (1-based) |
| wxPdfObject * wxPdfParser::GetPageResources | ( | unsigned int | pageno | ) |
Get the resources of a specific page.
| pageno | The page number (1-based) |
|
protected |
Get the resources of a specific page identified by a page object.
| int wxPdfParser::GetPageRotation | ( | unsigned int | pageno | ) |
Get the rotation of a specific page.
| pageno | The page number (1-based) |
|
protected |
Get a page rotation.
| wxPdfArrayDouble * wxPdfParser::GetPageTrimBox | ( | unsigned int | pageno | ) |
Get the trim box of a specific page.
| pageno | The page number (1-based) |
|
inline |
Get PDF version of parsed document.
| bool wxPdfParser::GetSourceInfo | ( | wxPdfInfo & | info | ) |
Get the document information dictionary.
| [out] | info | The info object to populate |
true if successful, false otherwise
|
protected |
Parse the content of a stream object.
|
protected |
Parse the raw content of a stream object.
|
inline |
Get flag whether a stream should be decoded or not.
true if skip decoding, false if decode | bool wxPdfParser::IsOk | ( | ) | const |
Check whether the PDF document to be parsed is valid.
true if the document was parsed successfully, false otherwise
|
protected |
Decode a stream that has the ASCII85Decode filter.
| osIn | the input data |
|
protected |
Parse an array.
|
protected |
Parse a dictionary.
|
protected |
Parse a direct object.
|
protected |
Parse PDF document.
|
protected |
Parse an object.
|
protected |
Parse an object from an object stream.
|
protected |
Parse the page tree of the PDF document.
|
protected |
Parse a specific object.
|
protected |
Parse the cross reference.
|
protected |
Parse a cross reference section.
|
protected |
Parse a cross reference stream.
| wxPdfObject * wxPdfParser::ResolveObject | ( | wxPdfObject * | obj | ) |
Resolve an object.
If the object is a reference, it is resolved to the actual object.
| obj | The object to resolve |
|
protected |
Setup a decryptor.
|
inline |
Set flag whether a stream should be decoded or not.
| useRawStream | true to skip decoding, false to decode |