#include <PdfParser.h>
Inheritance diagram for PoDoFo::PdfParser:
Public Member Functions | |
PdfParser (PdfVecObjects *pVecObjects) | |
PdfParser (PdfVecObjects *pVecObjects, const char *pszFilename, bool bLoadOnDemand=true) | |
PdfParser (PdfVecObjects *pVecObjects, const char *pBuffer, long lLen, bool bLoadOnDemand=true) | |
PdfParser (PdfVecObjects *pVecObjects, const PdfRefCountedInputDevice &rDevice, bool bLoadOnDemand=true) | |
virtual | ~PdfParser () |
void | ParseFile (const char *pszFilename, bool bLoadOnDemand=true) |
void | ParseFile (const char *pBuffer, long lLen, bool bLoadOnDemand=true) |
void | ParseFile (const PdfRefCountedInputDevice &rDevice, bool bLoadOnDemand=true) |
bool | QuickEncryptedCheck (const char *pszFilename) |
int | GetNumberOfIncrementalUpdates () const |
const PdfVecObjects * | GetObjects () const |
EPdfVersion | GetPdfVersion () const |
const char * | GetPdfVersionString () const |
const PdfObject * | GetTrailer () const |
bool | GetLoadOnDemand () const |
bool | IsLinearized () const |
size_t | GetFileSize () const |
bool | GetEncrypted () const |
const PdfEncrypt * | GetEncrypt () const |
PdfEncrypt * | TakeEncrypt () |
void | SetPassword (const std::string &sPassword) |
bool | IsStrictParsing () const |
void | SetStrictParsing (bool bStrict) |
bool | GetIgnoreBrokenObjects () |
void | SetIgnoreBrokenObjects (bool bBroken) |
Protected Member Functions | |
void | FindToken (const char *pszToken, const long lRange) |
void | FindToken2 (const char *pszToken, const long lRange, size_t searchEnd) |
void | ReadDocumentStructure () |
void | HasLinearizationDict () |
void | MergeTrailer (const PdfObject *pTrailer) |
void | ReadTrailer () |
void | ReadXRef (pdf_long *pXRefOffset) |
void | ReadXRefContents (pdf_long lOffset, bool bPositionAtEnd=false) |
void | ReadXRefSubsection (long long &nFirstObject, long long &nNumObjects) |
void | ReadXRefStreamContents (pdf_long lOffset, bool bReadOnlyTrailer) |
void | ReadObjects () |
void | ReadObjectsInternal () |
void | ReadObjectFromStream (int nObjNo, int nIndex) |
bool | IsPdfFile () |
void | CheckEOFMarker () |
|
Create a new PdfParser object You have to open a PDF file using ParseFile later.
|
|
Create a new PdfParser object and open a PDF file and parse it into memory.
|
|
Create a new PdfParser object and open a PDF file and parse it into memory.
|
|
Create a new PdfParser object and open a PDF file and parse it into memory.
|
|
Delete the PdfParser and all PdfObjects |
|
Checks for the existence of the %EOF marker at the end of the file When strict mode is off it will also attempt to setup the parser to ignore any garbage after the last %EOF marker Simply raises an error if there is a problem with the marker |
|
Searches backwards from the end of the file and tries to find a token. The current file is positioned right after the token.
|
|
Searches backwards from the specified position of the file and tries to find a token. The current file is positioned right after the token.
|
|
|
|
|
|
|
|
|
|
|
|
Retrieve the number of incremental updates that have been applied to the last parsed PDF file. 0 means no update has been applied.
|
|
Get a reference to the sorted internal objects vector.
|
|
Get the file format version of the pdf
|
|
Get the file format version of the pdf
|
|
Get the trailer dictionary which can be written unmodified to a pdf file. |
|
Checks wether this pdf is linearized or not. Initializes the linearization directory on sucess. |
|
|
|
Checks the magic number at the start of the pdf file and sets the m_ePdfVersion member to the correct version of the pdf file.
|
|
|
|
Merge the information of this trailer object in the parsers main trailer object.
|
|
Open a PDF file and parse it.
|
|
Open a PDF file and parse it.
|
|
Open a PDF file and parse it.
|
|
Quick method to detect secured PDF files, i.e. a PDF with an /Encrypt key in the trailer directory.
|
|
Reads the xref sections and the trailers of the file in the correct order in the memory and takes care for linearized pdf files. |
|
Read the object with index nIndex from the object stream nObjNo and push it on the objects vector m_vecOffsets. All objects are read from this stream and the stream object is free'd from memory. Further calls who try to read from the same stream simply do nothing.
|
|
Reads all objects from the pdf into memory from the offsets listed in m_vecOffsets. If required an encryption object is setup first. The actual reading happens in ReadObjectsInternal() either if no encryption is required or a correct encryption object was initialized from SetPassword. |
|
Reads all objects from the pdf into memory from the offsets listed in m_vecOffsets. Requires a correctly setup PdfEncrypt object with correct password. This method is called from ReadObjects or SetPassword.
|
|
Read the trailer directory at the end of the file. |
|
Looks for a startxref entry at the current file position and saves its byteoffset to pXRefOffset.
|
|
Reads the xref table from a pdf file. If there is no xref table, ReadXRefStreamContents() is called.
|
|
Reads a xref stream contens object
|
|
Read a xref subsection Throws ePdfError_NoXref if the number of objects read was not the number specified by the subsection header (as passed in `nNumObjects').
|
|
Specify if the parser should ignore broken objects, i.e. XRef entries that do not point to valid objects. Default is to not ignore broken objects and throw an exception if one is found.
|
|
If you try to open an encrypted PDF file, which requires a password to open, PoDoFo will throw a PdfError( ePdfError_InvalidPassword ) exception. If you got such an exception, you have to set a password which should be used for opening the PDF. The usual way will be to ask the user for the password and set the password using this method. PdfParser will immediately continue to read the PDF file.
|
|
Enable/disable strict parsing mode. Strict parsing is by default disabled. If you enable strict parsing, PoDoFo will fail on a few more common PDF failures. Please not that PoDoFo's parser is by default very strict already and does not recover from e.g. wrong XREF tables.
|
|
Takes the encryption object fro mthe parser. The internal handle will be set to NULL and the ownership of the object is given to the caller. Only call this if you need access to the encryption object before deleting the parser.
|