PoDoFo 0.9.6
PoDoFo::PdfDifferenceEncoding Class Reference

#include <PdfDifferenceEncoding.h>

Inheritance diagram for PoDoFo::PdfDifferenceEncoding:
PoDoFo::PdfEncoding PoDoFo::PdfElement

Public Types

enum  EBaseEncoding { eBaseEncoding_Font , eBaseEncoding_WinAnsi , eBaseEncoding_MacRoman , eBaseEncoding_MacExpert }

Public Member Functions

 PdfDifferenceEncoding (const PdfEncodingDifference &rDifference, PdfDocument *pParent, bool bAutoDelete=true)
 PdfDifferenceEncoding (const PdfEncodingDifference &rDifference, PdfVecObjects *pParent, bool bAutoDelete=true)
 PdfDifferenceEncoding (const PdfEncodingDifference &rDifference, EBaseEncoding eBaseEncoding, PdfDocument *pParent, bool bAutoDelete=true)
 PdfDifferenceEncoding (const PdfEncodingDifference &rDifference, EBaseEncoding eBaseEncoding, PdfVecObjects *pParent, bool bAutoDelete=true)
 PdfDifferenceEncoding (PdfObject *pObject, bool bAutoDelete=true, bool bExplicitNames=false, PdfObject *pToUnicode=NULL)
virtual void AddToDictionary (PdfDictionary &rDictionary) const
virtual PdfString ConvertToUnicode (const PdfString &rEncodedString, const PdfFont *pFont) const
virtual PdfRefCountedBuffer ConvertToEncoding (const PdfString &rString, const PdfFont *pFont) const
virtual bool IsAutoDelete () const
virtual bool IsSingleByteEncoding () const
const PdfEncodingDifferenceGetDifferences () const
virtual pdf_utf16be GetCharCode (int nIndex) const
Public Member Functions inherited from PoDoFo::PdfEncoding
bool operator== (const PdfEncoding &rhs) const
bool operator< (const PdfEncoding &rhs) const
int GetFirstChar () const
int GetLastChar () const
const_iterator begin () const
const_iterator end () const

Static Public Member Functions

static pdf_utf16be NameToUnicodeID (const PdfName &rName)
static PdfName UnicodeIDToName (pdf_utf16be inCodePoint)

Protected Member Functions

virtual const PdfNameGetID () const
Protected Member Functions inherited from PoDoFo::PdfEncoding
 PdfEncoding (int nFirstChar, int nLastChar, PdfObject *=NULL)

Additional Inherited Members

Protected Attributes inherited from PoDoFo::PdfEncoding
bool m_bToUnicodeIsLoaded
 If true, ToUnicode has been parsed.

Detailed Description

PdfDifferenceEncoding is an encoding, which is based on either the fonts encoding or a predefined encoding and defines differences to this base encoding.

Member Enumeration Documentation

◆ EBaseEncoding

Defines the base encoding from which a PdfDifferenceEncoding differs.

Enumerator
eBaseEncoding_Font 

Use The fonts encoding as base.

eBaseEncoding_WinAnsi 

Use WinAnsiEncoding as base encoding.

eBaseEncoding_MacRoman 

Use MacRomanEncoding as base encoding.

eBaseEncoding_MacExpert 

Use MacExpertEncoding as base encoding.

Constructor & Destructor Documentation

◆ PdfDifferenceEncoding() [1/5]

PoDoFo::PdfDifferenceEncoding::PdfDifferenceEncoding ( const PdfEncodingDifference & rDifference,
PdfDocument * pParent,
bool bAutoDelete = true )

Create a new PdfDifferenceEncoding which is based on the fonts encoding.

Parameters
rDifferencethe differences in this encoding
pParentparent PdfVecObjects. Add a newly created object to this vector.
bAutoDeleteif true the encoding is deleted by its owning font

◆ PdfDifferenceEncoding() [2/5]

PoDoFo::PdfDifferenceEncoding::PdfDifferenceEncoding ( const PdfEncodingDifference & rDifference,
PdfVecObjects * pParent,
bool bAutoDelete = true )

Create a new PdfDifferenceEncoding which is based on the fonts encoding.

Parameters
rDifferencethe differences in this encoding
pParentparent PdfDocument. Add a newly created object to this vector.
bAutoDeleteif true the encoding is deleted by its owning font

◆ PdfDifferenceEncoding() [3/5]

PoDoFo::PdfDifferenceEncoding::PdfDifferenceEncoding ( const PdfEncodingDifference & rDifference,
EBaseEncoding eBaseEncoding,
PdfDocument * pParent,
bool bAutoDelete = true )

Create a new PdfDifferenceEncoding which is based on a predefined encoding.

Parameters
rDifferencethe differences in this encoding
eBaseEncodingthe base encoding of this font
pParentparent PdfDocument. Add a newly created object to this vector.
bAutoDeleteif true the encoding is deleted by its owning font

◆ PdfDifferenceEncoding() [4/5]

PoDoFo::PdfDifferenceEncoding::PdfDifferenceEncoding ( const PdfEncodingDifference & rDifference,
EBaseEncoding eBaseEncoding,
PdfVecObjects * pParent,
bool bAutoDelete = true )

Create a new PdfDifferenceEncoding which is based on a predefined encoding.

Parameters
rDifferencethe differences in this encoding
eBaseEncodingthe base encoding of this font
pParentparent PdfVecObjects. Add a newly created object to this vector.
bAutoDeleteif true the encoding is deleted by its owning font

◆ PdfDifferenceEncoding() [5/5]

PoDoFo::PdfDifferenceEncoding::PdfDifferenceEncoding ( PdfObject * pObject,
bool bAutoDelete = true,
bool bExplicitNames = false,
PdfObject * pToUnicode = NULL )

Create a new PdfDifferenceEncoding from an existing object in a PDF file.

Parameters
pObjectan existing differences encoding
bAutoDeleteif true the encoding is deleted by its owning font
bExplicitNamesif true, glyph names are meaningless explicit keys on the font (used for Type3 fonts)

Member Function Documentation

◆ AddToDictionary()

void PoDoFo::PdfDifferenceEncoding::AddToDictionary ( PdfDictionary & rDictionary) const
virtual

Add this encoding object to a dictionary usually be adding an /Encoding key in font dictionaries.

Parameters
rDictionaryadd the encoding to this dictionary

Implements PoDoFo::PdfEncoding.

◆ ConvertToEncoding()

PdfRefCountedBuffer PoDoFo::PdfDifferenceEncoding::ConvertToEncoding ( const PdfString & rString,
const PdfFont * pFont ) const
virtual

Convert a unicode PdfString to a string encoded with this encoding.

Parameters
rStringan unicode PdfString.
pFontthe font for which this string is converted
Returns
an encoded PdfRefCountedBuffer. The PdfRefCountedBuffer is treated as a series of bytes and is allowed to have 0 bytes. The returned buffer must not be a unicode string.

Reimplemented from PoDoFo::PdfEncoding.

◆ ConvertToUnicode()

PdfString PoDoFo::PdfDifferenceEncoding::ConvertToUnicode ( const PdfString & rEncodedString,
const PdfFont * pFont ) const
virtual

Convert a string that is encoded with this encoding to an unicode PdfString.

Parameters
rEncodedStringa string encoded by this encoding. Usually this string was read from a content stream.
pFontthe font for which this string is converted
Returns
an unicode PdfString.

Reimplemented from PoDoFo::PdfEncoding.

◆ GetCharCode()

pdf_utf16be PoDoFo::PdfDifferenceEncoding::GetCharCode ( int nIndex) const
virtual

Get the unicode character code for this encoding at the position nIndex. nIndex is a position between GetFirstChar() and GetLastChar()

Parameters
nIndexcharacter code at position index
Returns
unicode character code
See also
GetFirstChar
GetLastChar

Will throw an exception if nIndex is out of range.

Implements PoDoFo::PdfEncoding.

◆ GetDifferences()

const PdfEncodingDifference & PoDoFo::PdfDifferenceEncoding::GetDifferences ( ) const
inline

Get read-only access to the object containing the actual differences.

Returns
the container with the actual differences

◆ GetID()

const PdfName & PoDoFo::PdfDifferenceEncoding::GetID ( ) const
inlineprotectedvirtual

Get a unique ID for this encoding which can used for comparisons!

Returns
a unique id for this encoding!

Implements PoDoFo::PdfEncoding.

◆ IsAutoDelete()

bool PoDoFo::PdfDifferenceEncoding::IsAutoDelete ( ) const
inlinevirtual
Returns
true if this encoding should be deleted automatically with the font.

Implements PoDoFo::PdfEncoding.

◆ IsSingleByteEncoding()

bool PoDoFo::PdfDifferenceEncoding::IsSingleByteEncoding ( ) const
inlinevirtual
Returns
true if this is a single byte encoding with a maximum of 256 values.

Implements PoDoFo::PdfEncoding.

◆ NameToUnicodeID()

pdf_utf16be PoDoFo::PdfDifferenceEncoding::NameToUnicodeID ( const PdfName & rName)
static

Convert a standard character name to a unicode code point

Parameters
rNamea standard character name
Returns
an unicode code point

◆ UnicodeIDToName()

PdfName PoDoFo::PdfDifferenceEncoding::UnicodeIDToName ( pdf_utf16be inCodePoint)
static

Convert an unicode code point to a standard character name

Parameters
inCodePointa code point
Returns
a standard character name of /.notdef if none could be found