ipe::PdfDict Class Reference
Ipe Base

`#include <ipepdfparser.h>`

Inherits ipe::PdfObj.

## Public Member Functions

| PdfDict ()
| ~PdfDict ()
virtual const PdfDict * | dict () const noexcept
String | dictRepr () const noexcept
void | dictWrite (Stream &stream, const PdfRenumber *renumber, bool inflate, int length) const noexcept
virtual void | write (Stream &stream, const PdfRenumber *renumber, bool inflate) const noexcept
void | setStream (const Buffer &stream)
void | add (String key, const PdfObj *obj)
const PdfObj * | get (String key, const PdfFile *file) const noexcept
bool | getNumber (String key, double &val, const PdfFile *file) const noexcept
bool | getNumberArray (String key, const PdfFile *file, std::vector< double > &vals) const noexcept
int | count () const noexcept
String | key (int index) const noexcept
const PdfObj * | value (int index) const noexcept
Buffer | stream () const noexcept
bool | deflated () const noexcept
Buffer | inflate () const noexcept
Public Member Functions inherited from ipe::PdfObj
virtual | ~PdfObj ()=0
virtual const PdfNull * | null () const noexcept
virtual const PdfBool * | boolean () const noexcept
virtual const PdfNumber * | number () const noexcept
virtual const PdfString * | string () const noexcept
virtual const PdfName * | name () const noexcept
virtual const PdfRef * | ref () const noexcept
virtual const PdfArray * | array () const noexcept
String | repr () const noexcept

## Detailed Description

The PDF dictionary and stream objects.

A dictionary may or may not have attached stream data.

## Constructor & Destructor Documentation

## PdfDict()

ipe::PdfDict::PdfDict | ( |  | ) |

inline explicit

References ipe::PdfObj::dict(), and ipe::PdfObj::write().

## ~PdfDict()

PdfDict::~PdfDict | ( |  | ) |

## Member Function Documentation

## dict()

const PdfDict * PdfDict::dict | ( |  | ) | const

virtual noexcept

Return this object as PDF dictionary object.

Reimplemented from ipe::PdfObj.

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

## dictRepr()

String PdfDict::dictRepr | ( |  | ) | const

noexcept

Return PDF representation of the PdfDict without the stream.

## dictWrite()

void PdfDict::dictWrite | ( | Stream & | stream,
|  | const PdfRenumber * | renumber,
|  | bool | inflate,
|  | int | length
| ) |  | const

noexcept

## write()

void PdfDict::write | ( | Stream & | stream,
|  | const PdfRenumber * | renumber,
|  | bool | inflate
| ) |  | const

virtual noexcept

Implements ipe::PdfObj.

References ipe::Buffer::size().

## setStream()

void PdfDict::setStream | ( | const Buffer & | stream | ) |

Add stream data to this dictionary.

## add()

void PdfDict::add | ( | String | key,
|  | const PdfObj * | obj
| ) |  |

Add a (key, value) pair to the dictionary.

Dictionary takes ownership of obj.

Referenced by ipe::PdfResources::collect().

## get()

const PdfObj * PdfDict::get | ( | String | key,
|  | const PdfFile * | file
| ) |  | const

noexcept

Look up key in dictionary.

Indirect objects (references) are looked up if file is not nullptr, and the object referred to is returned. Returns nullptr if key is not in dictionary.

Referenced by ipe::PdfFile::catalog(), ipe::PdfResources::collect(), ipe::Latex::createLatexSource(), ipe::CairoPainter::executeStream(), ipe::Document::formatFromFilename(), ipe::PdfFile::parse(), ipe::PdfFile::parseObjectStream(), ipe::Latex::readPdf(), ipe::PdfThumbnail::render(), ipe::PdfViewBase::setPage(), and ipe::PdfWriter::~PdfWriter().

## getNumber()

bool PdfDict::getNumber | ( | String | key,
|  | double & | val,
|  | const PdfFile * | file
| ) |  | const

noexcept

Retrieve a single number and stor in val.

References ipe::PdfObj::number(), and ipe::PdfNumber::value().

Referenced by ipe::Latex::createLatexSource(), and ipe::CairoPainter::executeStream().

## getNumberArray()

bool PdfDict::getNumberArray | ( | String | key,
|  | const PdfFile * | file,
|  | std::vector< double > & | vals
| ) |  | const

noexcept

Retrieve an array of numbers and store in vals.

References ipe::PdfObj::array(), ipe::PdfArray::count(), ipe::PdfObj::number(), ipe::PdfArray::obj(), and ipe::PdfNumber::value().

Referenced by ipe::Latex::createLatexSource(), ipe::CairoPainter::executeStream(), ipe::PdfFile::mediaBox(), and ipe::PdfWriter::~PdfWriter().

## count()

int ipe::PdfDict::count | ( |  | ) | const

inline noexcept

Referenced by ipe::PdfResources::collect(), ipe::Latex::createLatexSource(), ipe::CairoPainter::executeStream(), ipe::PdfResources::PdfResources(), ipe::Latex::readPdf(), and ipe::PdfWriter::~PdfWriter().

## key()

String ipe::PdfDict::key | ( | int | index | ) | const

inline noexcept

Referenced by ipe::PdfResources::collect(), ipe::Latex::createLatexSource(), ipe::CairoPainter::executeStream(), ipe::Latex::readPdf(), and ipe::PdfWriter::~PdfWriter().

## value()

const PdfObj* ipe::PdfDict::value | ( | int | index | ) | const

inline noexcept

Referenced by ipe::PdfResources::collect(), ipe::Latex::createLatexSource(), ipe::CairoPainter::executeStream(), ipe::PdfResources::PdfResources(), and ipe::PdfWriter::~PdfWriter().

## stream()

Buffer ipe::PdfDict::stream | ( |  | ) | const

inline noexcept

Referenced by ipe::Document::formatFromFilename(), ipe::Face::glyphIndex(), and ipe::PdfWriter::~PdfWriter().

## deflated()

bool PdfDict::deflated | ( |  | ) | const

noexcept

Is this stream compressed with flate compression?

References ipe::PdfObj::name(), and ipe::PdfName::value().

Referenced by ipe::Document::formatFromFilename(), and ipe::PdfWriter::~PdfWriter().

## inflate()

Buffer PdfDict::inflate | ( |  | ) | const

noexcept

Return the (uncompressed) stream data.

This only handles the /Flate compression.

References ipe::String::data(), ipe::InflateSource::getChar(), ipe::PdfParser::PdfParser(), and ipe::String::size().

Referenced by ipe::CairoPainter::executeStream(), ipe::Face::glyphIndex(), ipe::PdfFile::parseObjectStream(), and ipe::PdfWriter::~PdfWriter().

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

- ipepdfparser.h
- ipepdfparser.cpp