Public Member Functions | List of all members
ipe::PdfParser Class Reference

#include <ipepdfparser.h>

Public Member Functions

 PdfParser (DataSource &source)
void getChar ()
bool eos () const noexcept
PdfToken token () const noexcept
void getToken ()
PdfObjgetObject (bool lateStream=false)
PdfObjgetObjectDef (bool lateStream)
PdfDictgetTrailer ()
void skipXRef ()
std::vector< int > readXRef ()

Detailed Description

PDF parser.

The parser understands the syntax of PDF files, but very little of its semantics. It is meant to be able to parse PDF documents created by Ipe for loading, and to extract information from PDF files created by Pdflatex or Xelatex.

The parser reads a PDF file sequentially from front to back, ignores the contents of 'xref' sections, stores only generation 0 objects, and stops after reading the first 'trailer' section (so it cannot deal with files with incremental updates). It cannot handle stream objects whose /Length entry has been deferred (using an indirect object).

Constructor & Destructor Documentation

◆ PdfParser()

PdfParser::PdfParser ( DataSource source)

Construct with a data source.

References getChar(), and getToken().

Member Function Documentation

◆ getChar()

void ipe::PdfParser::getChar ( )

Referenced by getToken(), and PdfParser().

◆ eos()

bool ipe::PdfParser::eos ( ) const

Referenced by getToken().

◆ token()

PdfToken ipe::PdfParser::token ( ) const

Referenced by ipe::PdfFile::parse().

◆ getToken()

void PdfParser::getToken ( )

◆ getObject()

PdfObj * PdfParser::getObject ( bool  lateStream = false)

◆ getObjectDef()

PdfObj * PdfParser::getObjectDef ( bool  lateStream)

◆ getTrailer()

PdfDict * PdfParser::getTrailer ( )

Parse trailer dictionary (current token is 'trailer')

References ipe::PdfToken::EDictBg, getToken(), and ipe::PdfToken::iType.

Referenced by ipe::PdfFile::parse().

◆ skipXRef()

void PdfParser::skipXRef ( )

Skip xref table (current token is 'xref')

References getToken(), and ipe::PdfToken::iString.

◆ readXRef()

std::vector< int > PdfParser::readXRef ( )

Read xref table (current token is 'xref')

References getToken(), and ipe::PdfToken::iString.

Referenced by ipe::PdfFile::parse().

The documentation for this class was generated from the following files: