pdfedit  0.4.5
About: PDFedit is a free and open source library for manipulating PDF documents.
  Fossies Dox: pdfedit-0.4.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pdfobjects Namespace Reference

Namespaces

 utils
 

Classes

class  CAnnotation
 
class  CArray
 
class  CContentStream
 
class  CDict
 
class  DictIdxComparator
 
class  CInlineImage
 
struct  PropertyTraitSimple
 
struct  PropertyTraitSimple< pNull >
 
struct  PropertyTraitSimple< pBool >
 
struct  PropertyTraitSimple< pInt >
 
struct  PropertyTraitSimple< pReal >
 
struct  PropertyTraitSimple< pString >
 
struct  PropertyTraitSimple< pName >
 
struct  PropertyTraitSimple< pRef >
 
class  CObjectSimple
 
class  ContentsChangeTag
 
class  CPage
 
class  CPageAnnots
 
class  CPageAttributes
 
class  CPageChanges
 
class  CPageContents
 
class  CPageDisplay
 
class  CPageFonts
 
class  ICPageModule
 
class  PdfFileDeleter
 
class  CPdf
 
class  CStreamsXpdfReader
 
class  CStream
 
class  CXref
 
struct  DisplayParams
 
class  CObjectFactory
 
class  XPdfObjectFactory
 
class  CNullFactory
 
class  CDictFactory
 
class  CArrayFactory
 
class  CPageFactory
 
struct  IndiRef
 
class  IProperty
 
class  SimpleGenericOperator
 
class  TextSimpleOperator
 
class  UnknownCompositePdfOperator
 
class  InlineImageCompositePdfOperator
 
class  PdfOperator
 
class  CompositePdfOperator
 
struct  AcceptingPdfOperatorIterator
 
struct  RejectingPdfOperatorIterator
 
struct  ChangePdfOperatorIterator
 
struct  Specification
 
class  StateUpdater
 
struct  TextSearchParams
 
class  XRefWriter
 

Typedefs

typedef
observer::ObserverHandler
< CContentStream
CContentStreamObserverSubject
 
typedef CObjectSimple< pNullCNull
 
typedef CObjectSimple< pBoolCBool
 
typedef CObjectSimple< pIntCInt
 
typedef CObjectSimple< pRealCReal
 
typedef CObjectSimple< pStringCString
 
typedef CObjectSimple< pNameCName
 
typedef CObjectSimple< pRefCRef
 
typedef std::map< IndiRef,
size_t, utils::IndComparator
PageTreeNodeCountCache
 
typedef std::map< IndiRef,
IndiRef, utils::IndComparator
PageTreeKidsParentCache
 
typedef std::pair< IndiRef,
enum ResolveRefState
ResolvedRefEntry
 
typedef std::map< IndiRef,
ResolvedRefEntry
*, utils::IndComparator
ResolvedRefStorage
 
typedef std::map< const
IndiRef, boost::shared_ptr
< IProperty >
, utils::IndComparator
IndirectMapping
 
typedef uintptr_t cpdf_id_t
 
typedef std::map< cpdf_id_t,
ResolvedRefStorage * > 
ResolvedRefMapping
 
typedef struct
pdfobjects::DisplayParams 
DisplayParams
 
typedef CObjectFactory< CIntCIntFactory
 
typedef CObjectFactory< CRealCRealFactory
 
typedef CObjectFactory< CStringCStringFactory
 
typedef CObjectFactory< CNameCNameFactory
 
typedef CObjectFactory< CBoolCBoolFactory
 
typedef CObjectFactory< CRefCRefFactory
 
typedef struct pdfobjects::IndiRef IndiRef
 
typedef
observer::ObserverHandler
< IProperty
IPropertyObserverSubject
 
typedef observer::IObserver
< IProperty
IPropertyObserver
 
typedef
AcceptingPdfOperatorIterator
< 4, itTextIterator
TextOperatorIterator
 
typedef struct
AcceptingPdfOperatorIterator
< 4, itFontIterator
FontOperatorIterator
 
typedef struct
AcceptingPdfOperatorIterator
< 1, itInlineImageIterator
InlineImageOperatorIterator
 
typedef struct
RejectingPdfOperatorIterator
< 38, itChangeableIterator
ChangeableOperatorIterator
 
typedef struct
AcceptingPdfOperatorIterator
< 4, itNonStrokingIterator
NonStrokingOperatorIterator
 
typedef struct
AcceptingPdfOperatorIterator
< 4, itStrokingIterator
StrokingOperatorIterator
 
typedef struct
AcceptingPdfOperatorIterator
< 24, itGraphicalIterator
GraphicalOperatorIterator
 
typedef struct
pdfobjects::TextSearchParams 
TextSearchParams
 

Enumerations

enum  ResolveRefState { STATE_NEW, STATE_RESOLVING, STATE_RESOLVED }
 
enum  PropertyType {
  pNull = objNull, pBool = objBool, pInt = objInt, pReal = objReal,
  pString = objString, pName = objName, pRef = objRef, pArray = objArray,
  pDict = objDict, pStream = objStream, pOther = objCmd, pOther1 = objError,
  pOther2 = objEOF, pOther3 = objNone
}
 
enum  IteratorType {
  itTextIterator, itFontIterator, itInlineImageIterator, itNonStrokingIterator,
  itStrokingIterator, itChangeableIterator, itGraphicalIterator
}
 

Functions

bool containsNonStrokingOperator (boost::shared_ptr< PdfOperator > oper)
 
bool containsStrokingOperator (boost::shared_ptr< PdfOperator > oper)
 
bool isOutline (boost::shared_ptr< IProperty > ip)
 
std::string getOutlineText (boost::shared_ptr< IProperty > ip)
 
bool isPage (boost::shared_ptr< IProperty > ip)
 
template size_t CPageContents::findText< std::vector< libs::Rectangle > > (std::string text, std::vector< libs::Rectangle > &recs, const TextSearchParams &params) const
 
void deleteResolveRefStorage (ResolvedRefStorage *storage)
 
void removeResolveRefMapping (const cpdf_id_t &orignalId, ResolvedRefMapping &map, const cpdf_id_t &id)
 
cpdf_id_t getIdFromCPdf (const CPdf *pdf)
 
CPdfgetCPdfFromId (const cpdf_id_t &id)
 
IndiRef createMapping (ResolvedRefStorage &container, XRefWriter &xref, IndiRef &oldRef, ResolvedRefEntry **entry)
 
template<typename IP >
boost::shared_ptr< CDictgetCDictFromDict (IP &ip, const std::string &key)
 
std::ostream & operator<< (std::ostream &out, const IndiRef &ref)
 
std::ostream & operator<< (std::ostream &out, const ::Ref &ref)
 
std::ostream & operator<< (std::ostream &out, PropertyType type)
 
std::ostream & operator<< (std::ostream &out,::ObjType type)
 
bool isPdfValid (boost::weak_ptr< CPdf > pdf)
 
bool hasValidPdf (const IProperty &ip)
 
template<typename T >
bool hasValidPdf (T ip)
  More...
 
bool isRefValid (const IndiRef *ref)
 
template<typename T >
bool hasValidRef (T ip)
 
bool hasValidRef (IProperty &ip)
 
template<PropertyType Type>
bool isIPType (const IProperty &ip)
 
template<PropertyType Type>
bool isIPType (boost::shared_ptr< IProperty > ip)
 
template<typename T >
bool isNull (T &ip)
 
template<typename T >
bool isInt (T &ip)
  More...
 
template<typename T >
bool isReal (T &ip)
  More...
 
template<typename T >
bool isNumber (T &ip)
  More...
 
template<typename T >
bool isString (T &ip)
  More...
 
template<typename T >
bool isName (T &ip)
  More...
 
template<typename T >
bool isRef (T &ip)
  More...
 
template<typename T >
bool isDict (T &ip)
  More...
 
template<typename T >
bool isArray (T &ip)
  More...
 
template<typename T >
bool isStream (T &ip)
  More...
 
template<int i>
std::string getStringType ()
 
template<>
std::string getStringType< 0 > ()
 
template<>
std::string getStringType< 1 > ()
 
template<>
std::string getStringType< 2 > ()
 
template<>
std::string getStringType< 3 > ()
 
template<>
std::string getStringType< 4 > ()
 
template<>
std::string getStringType< 5 > ()
 
template<>
std::string getStringType< 9 > ()
 
template<>
std::string getStringType< 6 > ()
 
template<>
std::string getStringType< 7 > ()
 
template<>
std::string getStringType< 8 > ()
 
boost::shared_ptr< PdfOperatorcreateOperator (const std::string &name, PdfOperator::Operands &operands)
 
boost::shared_ptr< PdfOperatorcreateOperator (const char *name, PdfOperator::Operands &operands)
 
boost::shared_ptr< PdfOperatorcreateOperatorTranslation (double x, double y)
 
boost::shared_ptr< PdfOperatorcreateOperatorScale (double width, double height)
 
boost::shared_ptr
< CompositePdfOperator
findCompositeOfPdfOperator (PdfOperator::Iterator it, boost::shared_ptr< PdfOperator > oper)
 
bool isCompositeOp (const PdfOperator *oper)
 
bool isCompositeOp (PdfOperator::Iterator it)
 
bool isCompositeOp (boost::shared_ptr< PdfOperator > oper)
 
bool isInlineImageOp (const PdfOperator *oper)
 
bool isInlineImageOp (boost::shared_ptr< PdfOperator > oper)
 
shared_ptr< PdfOperatorgetLastOperator (shared_ptr< PdfOperator > oper)
 
bool isPdfOp (const PdfOperator &op, const std::string &opn)
 
bool isPdfOp (const PdfOperator &op, const std::string &opn1, const std::string &opn2)
 
bool isPdfOp (const PdfOperator &op, const std::string &opn1, const std::string &opn2, const std::string &opn3)
 
bool isPdfOp (const PdfOperator &op, const std::string &opn1, const std::string &opn2, const std::string &opn3, const std::string &opn4)
 
template<typename T >
bool isPdfOp (const T &op, const std::string &opn)
 
template<typename T >
bool isPdfOp (const T &op, const std::string &opn1, const std::string &opn2)
 
template<typename T >
bool isPdfOp (const T &op, const std::string &opn1, const std::string &opn2, const std::string &opn3)
 
template<typename T >
bool isPdfOp (const T &op, const std::string &opn1, const std::string &opn2, const std::string &opn3, const std::string &opn4)
 
boost::shared_ptr< PdfOperatorgetLastOperator (boost::shared_ptr< PdfOperator > oper)
 
boost::shared_ptr< PdfOperatorgetLastOperator (PdfOperator::Iterator it)
 
bool checkAndFixOperator (const StateUpdater::CheckTypes &ops, PdfOperator::Operands &operands)
 
bool isSimpleOp (const StateUpdater::CheckTypes &chck)
 
bool isTextOp (const StateUpdater::CheckTypes &chck)
 
size_t getPrevFromTrailer (Object *trailer)
 

Variables

const int MAXOBJNUM = INT_MAX
 
const int MAXOBJGEN = 65535
 

Typedef Documentation

Definition at line 291 of file cobjectsimple.h.

Factory class for CBool creation.

Use getInstance methods for instants creation.

Definition at line 160 of file factories.h.

Changeable operator iterator.

Constructed from an arbitrary operator, but it will always start from a valid common operator. This is done in the constructor.

This iterator excludes operators like q, Q etc.

Definition at line 201 of file pdfoperatorsiter.h.

Definition at line 292 of file cobjectsimple.h.

Factory class for CInt creation.

Use getInstance methods for instants creation.

Definition at line 136 of file factories.h.

Definition at line 295 of file cobjectsimple.h.

Factory class for CName creation.

Use getInstance methods for instants creation.

Definition at line 154 of file factories.h.

Definition at line 290 of file cobjectsimple.h.

typedef uintptr_t pdfobjects::cpdf_id_t

Type for pdf identificator.

Definition at line 138 of file cpdf.h.

Definition at line 293 of file cobjectsimple.h.

Factory class for CReal creation.

Use getInstance methods for instants creation.

Definition at line 142 of file factories.h.

Definition at line 296 of file cobjectsimple.h.

Factory class for CRef creation.

Use getInstance methods for instants creation.

Definition at line 166 of file factories.h.

Definition at line 294 of file cobjectsimple.h.

Factory class for CString creation.

Use getInstance methods for instants creation.

Definition at line 148 of file factories.h.

Graphical state parameters.

These parameters are used by xpdf when updating bounding boxex of content stream operators, displaying page etc.

Font operator iterator.

Constructed from an arbitrary operator, but it will always start from a valid font operator. This is done in the constructor.

This iterator traverses only through operators that alter graphical font state.

Definition at line 181 of file pdfoperatorsiter.h.

Graphical operator iterator.

Constructed from an arbitrary operator, but it will always start from a valid graphical operator. This is done in the constructor.

This iterator iterates over all graphical operators on a page this includes lines, rectangles, paths.

Definition at line 238 of file pdfoperatorsiter.h.

Indirect properties mapping type.

Definition at line 134 of file cpdf.h.

Two numbers specifying indirect reference of a pdf object.

Inline image iterator.

Constructed from an arbitrary operator, but it will always start from a valid inline image operator. This is done in the constructor.

Definition at line 190 of file pdfoperatorsiter.h.

"Non stroking" operator iterator.

This iterator traverses only operators that are connected with non stroking operations.

REMARK: See pdf specification for details.

See Also
StrokingOperatorIterator

Definition at line 214 of file pdfoperatorsiter.h.

Type for page tree kids array to parrent mapping.

See Also
CPdf::pageTreeKidsParentCache

Definition at line 93 of file cpdf.h.

Type for page tree node count chache. It is mapping where key is indirect reference of page tree node and associated value is current number of direct pages under this node.

Definition at line 88 of file cpdf.h.

Entry for reference translation mapping. Firts value stands for the new reference (translated one) and the second keeps state of the translation.

Definition at line 113 of file cpdf.h.

Type for mapping from pdfs to their resolved storage. Maps pdf identificators to their resolved reference storage.

Definition at line 143 of file cpdf.h.

Type for reference translation mappings. Key stands for reference in original property and associated value stands for reserved reference (with its current resolvetion state) which stands for resolved reference.
Mapping is used for adding indirect properties from different pdf. Referncies are bound to (unique in) specific document. If we want to insert subtree of indirect properties from one document to another we have to translate all referenced indirect objects which all needs translation. Therefore a new reference is created for each and this mapping holds translation from the original to the created one.

See Also
CPdf::addIndirectProperty

Definition at line 129 of file cpdf.h.

"Stroking" operator iterator.

This iterator traverses only operators that are connected with stroking operations.

REMARK: See pdf specification for details.

See Also
NonStrokingOperatorIterator

Definition at line 227 of file pdfoperatorsiter.h.

Text operator iterator.

Constructed from an arbitrary operator, but it will always start from a valid text operator. This is done in the constructor.

Definition at line 170 of file pdfoperatorsiter.h.

Text search parameters.

These parameters are used by xpdf when serching a text string.

Enumeration Type Documentation

Iterator types. Needed when constructing specific iterators using templates.

Enumerator
itTextIterator 
itFontIterator 
itInlineImageIterator 
itNonStrokingIterator 
itStrokingIterator 
itChangeableIterator 
itGraphicalIterator 

Definition at line 50 of file pdfoperatorsiter.h.

Enum describing property type.

Enumerator
pNull 
pBool 
pInt 
pReal 
pString 
pName 
pRef 
pArray 
pDict 
pStream 
pOther 
pOther1 
pOther2 
pOther3 

Definition at line 50 of file iproperty.h.

State of reference translation.

  • STATE_NEW represents a new mapping. This means that a new reference was for translation and it is not backed up by any real object.
  • STATE_RESOLVING represents mapping which is currently in translation meaning that the real object which will be backed by translated reference is in progress of construction.
  • STATE_RESOLVED represents mapping which is finally backed by real indirect object.
Enumerator
STATE_NEW 
STATE_RESOLVING 
STATE_RESOLVED 

Definition at line 107 of file cpdf.h.

Function Documentation

bool pdfobjects::checkAndFixOperator ( const pdfobjects::StateUpdater::CheckTypes ops,
PdfOperator::Operands &  operands 
)

Check if the operands match the specification and replace operand with its stronger equivalent.

(e.g. When xpdf returns an object with integer type, but the operand can be a real, we have to convert it to real.)

Parameters
opsOperator specification
operandsOperand stack.
Returns
True if type and count match, false otherwise.

Definition at line 1189 of file stateupdater.cc.

References pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, debug::DBG_ERR, debug::DBG_ERR, isBitSet(), isBitSet(), isInt(), QS::min(), pReal, pdfobjects::StateUpdater::CheckTypes::types, pdfobjects::StateUpdater::CheckTypes::types, pdfobjects::StateUpdater::CheckTypes::types, utilsPrintDbg, and utilsPrintDbg.

Referenced by createOperator().

bool pdfobjects::containsNonStrokingOperator ( boost::shared_ptr< PdfOperator >  oper)

Tries to find first non stroking operator.

Some operators are modified by stroking operators some by nonstroking. (e.g. when changing color, we can change color either of a stroking operator using RG operator or of a nonstroking operator using rg operator. RG operator does not change color of nonstroking operators.)

Parameters
operPdf operator that will be searched for a non stroking operator.
Returns
True if found, false otherwise.

Definition at line 1126 of file ccontentstream.cc.

References iterator::DoubleListIterator< Item >::isEnd().

Referenced by gui::QSPdfOperator::containsNonStrokingOperator().

bool pdfobjects::containsStrokingOperator ( boost::shared_ptr< PdfOperator >  oper)

Tries to find first stroking operator.

Some operators are modified by stroking operators some by nonstroking. (e.g. when changing color, we can change color either of a stroking operator using RG operator or of a nonstroking operator using rg operator. RG operator does not change color of nonstroking operators.)

Parameters
operPdf operator that will be searched for a stroking operator.
Returns
True if found, false otherwise.

Definition at line 1139 of file ccontentstream.cc.

References iterator::DoubleListIterator< Item >::isEnd().

Referenced by gui::QSPdfOperator::containsStrokingOperator().

template size_t pdfobjects::CPageContents::findText< std::vector< libs::Rectangle > > ( std::string  text,
std::vector< libs::Rectangle > &  recs,
const TextSearchParams &  params 
) const
IndiRef pdfobjects::createMapping ( ResolvedRefStorage &  container,
XRefWriter &  xref,
IndiRef &  oldRef,
ResolvedRefEntry **  entry 
)

Reserves new referenece and creates mapping.

Parameters
containerResolved mapping container.
xrefXRefWriter for new reference reservation.
oldRefOriginal reference.
entryPointer for resolved ref mapping entry.

Reserves a new reference with XRefWriter::reserveRef method and if oldRef is valid reference (checks with isRefValid method) also creates mapping [oldRef, newRef to given container with STATE_NEW state and given entry will point to the mapping entry pointer.

Returns
newly reseved reference entry.

Definition at line 1978 of file cpdf.cc.

References isRefValid(), kernelPrintDbg, kernelPrintDbg, NULL, pdfobjects::XRefWriter::reserveRef(), and STATE_NEW.

Referenced by pdfobjects::CPdf::addIndirectProperty(), and pdfobjects::CPdf::subsReferencies().

boost::shared_ptr< PdfOperator > pdfobjects::createOperator ( const std::string &  name,
PdfOperator::Operands &  operands 
)

Factory function for operators creation. Creates instance depending on type of the operator.
Note that this function doesn't cover inline images (BI operator).

Parameters
nameOpertor name.
operandsOperands for operator.
Returns
Valid pdfoperator object.
Exceptions
ElementBadTypeExceptionif operator or its operands are not valid.
NotImplementedExceptionif given operator is inline image (BI).

Definition at line 499 of file pdfoperators.cc.

References pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, pdfobjects::StateUpdater::CheckTypes::argNum, checkAndFixOperator(), debug::DBG_DBG, pdfobjects::StateUpdater::CheckTypes::endTag, pdfobjects::StateUpdater::findOp(), isSimpleOp(), isTextOp(), pdfobjects::StateUpdater::CheckTypes::name, pdfobjects::StateUpdater::CheckTypes::name, pdfobjects::StateUpdater::CheckTypes::name, pdfobjects::StateUpdater::CheckTypes::name, NULL, pdfobjects::SimpleGenericOperator::SimpleGenericOperator(), pdfobjects::TextSimpleOperator::TextSimpleOperator(), and utilsPrintDbg.

Referenced by pdfobjects::CPageContents::addInlineImage(), addText(), addText(), addText(), addText(), addText(), pdfobjects::CPageContents::addText(), pdfobjects::CPageContents::addText(), pdfobjects::CPageContents::addText(), pdfobjects::CPageContents::addText(), pdfobjects::CPageContents::addText(), pdfobjects::SimpleGenericOperator::clone(), pdfobjects::ContentsChangeTag::create(), gui::Base::createOperator(), createOperator(), createOperatorScale(), createOperatorTranslation(), and pdfobjects::CPageDisplay::setTransformMatrix().

boost::shared_ptr< PdfOperator > pdfobjects::createOperator ( const char *  name,
PdfOperator::Operands &  operands 
)

Factory function for operators creation. Transforms const char parameter to the string and delegates to createOperator(std::string&, PdfOperator::Operands&)

Parameters
nameOpertor name.
operandsOperands for operator.
Returns
Valid pdfoperator object.
Exceptions
ElementBadTypeExceptionif operator or its operands are not valid.
NotImplementedExceptionif given operator is inline image (BI).

Definition at line 537 of file pdfoperators.cc.

References createOperator(), and name.

boost::shared_ptr< PdfOperator > pdfobjects::createOperatorScale ( double  width,
double  height 
)

Create scaling operator.

Definition at line 556 of file pdfoperators.cc.

References createOperator().

Referenced by pdfobjects::CPageContents::addInlineImage().

boost::shared_ptr< PdfOperator > pdfobjects::createOperatorTranslation ( double  x,
double  y 
)

Create translation operator.

Definition at line 543 of file pdfoperators.cc.

References createOperator().

Referenced by pdfobjects::CPageContents::addInlineImage().

void pdfobjects::deleteResolveRefStorage ( ResolvedRefStorage *  storage)

Deallocates given storage (with all its elements).

Parameters
storageResolve storage to deallocate.

Definition at line 1716 of file cpdf.cc.

Referenced by removeResolveRefMapping().

boost::shared_ptr< CompositePdfOperator > pdfobjects::findCompositeOfPdfOperator ( PdfOperator::Iterator  begin,
boost::shared_ptr< PdfOperator >  oper 
)
template<typename IP >
boost::shared_ptr<CDict> pdfobjects::getCDictFromDict ( IP &  ip,
const std::string &  key 
)
inline
CPdf* pdfobjects::getCPdfFromId ( const cpdf_id_t &  id)

Translates id to the pdf instance pointer.

Parameters
idPdf id generated by getIdFromCPdf.
Returns
Pointer to CPdf instance associated with given id.

Definition at line 1764 of file cpdf.cc.

Referenced by pdfobjects::CPdf::releasePdfId(), and pdfobjects::CPdf::setPdfId().

cpdf_id_t pdfobjects::getIdFromCPdf ( const CPdf *  pdf)

Translates pdf to its id. This translation can be reversed by getCPdfFromId method.

Returns
id for pdf instance.

Definition at line 1754 of file cpdf.cc.

Referenced by pdfobjects::CPdf::setPdfId().

boost::shared_ptr<PdfOperator> pdfobjects::getLastOperator ( boost::shared_ptr< PdfOperator >  oper)

Get last operator if a composite.

Parameters
operOperator.
Returns
Last operator of a composite.
boost::shared_ptr<PdfOperator> pdfobjects::getLastOperator ( PdfOperator::Iterator  it)
inline

Get last operator if a composite.

Parameters
itIterator.
Returns
Iterator over last operator of a composite.

Definition at line 485 of file pdfoperatorsbase.h.

References iterator::DoubleListIterator< Item >::getCurrent(), and getLastOperator().

std::string pdfobjects::getOutlineText ( boost::shared_ptr< IProperty >  ip)

Get text from an outline.

Parameters
ipOutline dictionary.

Definition at line 64 of file coutline.cc.

References pdfobjects::utils::getStringFromDict(), isOutline(), and isOutline().

size_t pdfobjects::getPrevFromTrailer ( Object trailer)

Gets value of the Prev field from given trailer.

Parameters
trailerTrailer stream or dictionary.

This method correctly distinguishes between trailer dictionary and stream.

Returns
Value of the Prev field or -1 on error (Prev not present or invalid value).

Definition at line 562 of file xrefwriter.cc.

References ERR_OFFSET, ERR_OFFSET, ERR_OFFSET, Object::getDict(), pdfobjects::XPdfObjectFactory::getInstance(), Object::getStream(), Object::getType(), Object::isDict(), Object::isStream(), kernelPrintDbg, kernelPrintDbg, Dict::lookupNF(), NULL, and objInt.

Referenced by pdfobjects::XRefWriter::collectRevisions().

template<int i>
std::string pdfobjects::getStringType ( )
inline

Get string representation of specified type.

Definition at line 386 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 0 > ( )
inline

Get string representation of specified type.

Definition at line 389 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 1 > ( )
inline

Get string representation of specified type.

Definition at line 392 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 2 > ( )
inline

Get string representation of specified type.

Definition at line 395 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 3 > ( )
inline

Get string representation of specified type.

Definition at line 398 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 4 > ( )
inline

Get string representation of specified type.

Definition at line 401 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 5 > ( )
inline

Get string representation of specified type.

Definition at line 404 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 6 > ( )
inline

Get string representation of specified type.

Definition at line 410 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 7 > ( )
inline

Get string representation of specified type.

Definition at line 413 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 8 > ( )
inline

Get string representation of specified type.

Definition at line 416 of file iproperty.h.

template<>
std::string pdfobjects::getStringType< 9 > ( )
inline

Get string representation of specified type.

Definition at line 407 of file iproperty.h.

bool pdfobjects::hasValidPdf ( const IProperty &  ip)
inline

Checks whether iproprety belongs to a valid pdf.

Parameters
ipProperty to check.
Returns
isPdfValid(ip-&getPdf()).

Definition at line 320 of file iproperty.h.

References pdfobjects::IProperty::getPdf(), and isPdfValid().

Referenced by pdfobjects::CArray::addProperty(), pdfobjects::CDict::addProperty(), pdfobjects::CPdf::addProperty(), pdfobjects::CPageContents::addToBack(), pdfobjects::CPageContents::addToBack(), pdfobjects::CPageContents::addToBack(), pdfobjects::CPageContents::addToBack(), pdfobjects::CPageContents::addToFront(), pdfobjects::CPageContents::addToFront(), pdfobjects::CPageContents::addToFront(), pdfobjects::CContentStream::CContentStream(), pdfobjects::CContentStream::CContentStream(), pdfobjects::CPageContents::convert(), pdfobjects::CArray::delProperty(), pdfobjects::CDict::delProperty(), pdfobjects::IProperty::dispatchChange(), pdfobjects::IProperty::dispatchChange(), pdfobjects::CPageChanges::displayChange(), pdfobjects::CContentStream::frontInsertOperator(), pdfobjects::CPage::getPagePosition(), pdfobjects::utils::getReferencedObject(), pdfobjects::utils::getReferencedObject(), pdfobjects::SimpleGenericOperator::init_operands(), pdfobjects::CContentStream::insertOperator(), pdfobjects::utils::objHasParent(), pdfobjects::utils::objHasParent(), pdfobjects::CStreamsXpdfReader< T >::open(), pdfobjects::CPageContents::remove(), pdfobjects::CPageContents::reparse(), pdfobjects::CContentStream::replaceOperator(), pdfobjects::CPageContents::setContents(), pdfobjects::CPageContents::setContents(), pdfobjects::CArray::setProperty(), pdfobjects::CDict::setProperty(), pdfobjects::CObjectSimple< Tp >::setStringRepresentation(), pdfobjects::CObjectSimple< Tp >::setValue(), and pdfobjects::CPdf::subsReferencies().

template<typename T >
bool pdfobjects::hasValidPdf ( ip)
inline

Checks whether iproprety belongs to a valid pdf.

Parameters
ipProperty to check.
Returns
isPdfValid(ip-&getPdf()).

Definition at line 326 of file iproperty.h.

References isPdfValid().

bool pdfobjects::hasValidRef ( IProperty &  ip)
inline

Definition at line 344 of file iproperty.h.

References pdfobjects::IProperty::getIndiRef(), and isRefValid().

bool pdfobjects::isCompositeOp ( const PdfOperator *  oper)
inline
bool pdfobjects::isCompositeOp ( PdfOperator::Iterator  it)
inline

Is an operator a composite.

Definition at line 336 of file pdfoperators.h.

References iterator::DoubleListIterator< Item >::getCurrent(), and isCompositeOp().

bool pdfobjects::isCompositeOp ( boost::shared_ptr< PdfOperator >  oper)
inline

Is an operator a composite.

Definition at line 341 of file pdfoperators.h.

References isCompositeOp().

bool pdfobjects::isInlineImageOp ( const PdfOperator *  oper)
inline

Is an operator an inline image.

Definition at line 347 of file pdfoperators.h.

References NULL.

Referenced by isInlineImageOp().

bool pdfobjects::isInlineImageOp ( boost::shared_ptr< PdfOperator >  oper)
inline

Is an operator an inline image.

Definition at line 354 of file pdfoperators.h.

References isInlineImageOp().

template<PropertyType Type>
bool pdfobjects::isIPType ( const IProperty &  ip)
inline

Is iproperty of a specified type.

Definition at line 350 of file iproperty.h.

References pdfobjects::IProperty::getType().

template<PropertyType Type>
bool pdfobjects::isIPType ( boost::shared_ptr< IProperty >  ip)
inline

Is iproperty of a specified type.

Definition at line 353 of file iproperty.h.

template<typename T >
bool pdfobjects::isName ( T &  ip)
inline
template<typename T >
bool pdfobjects::isNumber ( T &  ip)
inline

Is IProperty of specified type.

Definition at line 361 of file iproperty.h.

bool pdfobjects::isOutline ( boost::shared_ptr< IProperty >  ip)

Checks whether the object is an ouline according to pdf specification.

Parameters
ipThis iproperty is checked whether it is an outline.

Definition at line 43 of file coutline.cc.

References isDict().

Referenced by getOutlineText(), and getOutlineText().

bool pdfobjects::isPage ( boost::shared_ptr< IProperty >  ip)

Check whether iproperty claimed to be a page is conforming to the pdf specification. (p.118)

Parameters
ipIProperty.

Definition at line 301 of file cpage.cc.

References pdfobjects::utils::getStringFromDict(), isDict(), isDict(), pdfobjects::Specification::Dict::TYPE, and pdfobjects::Specification::Page::TYPE.

bool pdfobjects::isPdfOp ( const PdfOperator &  op,
const std::string &  opn 
)
inline
bool pdfobjects::isPdfOp ( const PdfOperator &  op,
const std::string &  opn1,
const std::string &  opn2 
)
inline

Definition at line 415 of file pdfoperatorsbase.h.

References pdfobjects::PdfOperator::getOperatorName().

bool pdfobjects::isPdfOp ( const PdfOperator &  op,
const std::string &  opn1,
const std::string &  opn2,
const std::string &  opn3 
)
inline

Definition at line 424 of file pdfoperatorsbase.h.

References pdfobjects::PdfOperator::getOperatorName().

bool pdfobjects::isPdfOp ( const PdfOperator &  op,
const std::string &  opn1,
const std::string &  opn2,
const std::string &  opn3,
const std::string &  opn4 
)
inline

Definition at line 434 of file pdfoperatorsbase.h.

References pdfobjects::PdfOperator::getOperatorName().

template<typename T >
bool pdfobjects::isPdfOp ( const T &  op,
const std::string &  opn 
)
inline

Is specific operator.

Definition at line 448 of file pdfoperatorsbase.h.

References isPdfOp().

template<typename T >
bool pdfobjects::isPdfOp ( const T &  op,
const std::string &  opn1,
const std::string &  opn2 
)
inline

Definition at line 452 of file pdfoperatorsbase.h.

References isPdfOp().

template<typename T >
bool pdfobjects::isPdfOp ( const T &  op,
const std::string &  opn1,
const std::string &  opn2,
const std::string &  opn3 
)
inline

Definition at line 456 of file pdfoperatorsbase.h.

References isPdfOp().

template<typename T >
bool pdfobjects::isPdfOp ( const T &  op,
const std::string &  opn1,
const std::string &  opn2,
const std::string &  opn3,
const std::string &  opn4 
)
inline

Definition at line 460 of file pdfoperatorsbase.h.

References isPdfOp().

bool pdfobjects::isPdfValid ( boost::weak_ptr< CPdf >  pdf)
inline

Checks whether pdf is valid.

Parameters
pdfPdf isntance to check.
Returns
true if pdf is not NULL, false otherwise.

Definition at line 308 of file iproperty.h.

References NULL.

Referenced by hasValidPdf(), and hasValidPdf().

template<typename T >
bool pdfobjects::isReal ( T &  ip)
inline

Is IProperty of specified type.

Definition at line 359 of file iproperty.h.

Referenced by TestCPdf::indirectPropertyTC(), and TestCPdf::indirectPropertyTC().

template<typename T >
bool pdfobjects::isRef ( T &  ip)
inline

Is IProperty of specified type.

Definition at line 367 of file iproperty.h.

Referenced by pdfobjects::CPdf::addIndirectProperty(), Annot::Annot(), pdfobjects::CPdf::consolidatePageTree(), pdfobjects::CPdf::consolidatePageTree(), pdfobjects::CPdf::consolidatePageTree(), pdfobjects::CPdf::consolidatePageTree(), TestStream::contentStreamTC(), TestStream::contentStreamTC(), TestStream::contentStreamTC(), pdfobjects::CPageAttributes::fillInherited(), pdfobjects::CPageAttributes::fillInherited(), pdfobjects::CPageAttributes::fillInherited(), pdfobjects::CPageAttributes::fillInherited(), pdfobjects::CPageAttributes::fillInherited(), pdfobjects::utils::findPageDict(), pdfobjects::utils::findPageDict(), pdfobjects::utils::getCObjectFromRef(), pdfobjects::utils::getKidsCount(), pdfobjects::utils::getKidsCount(), pdfobjects::utils::getKidsFromInterNode(), pdfobjects::utils::getNodePosition(), pdfobjects::utils::getNodeType(), pdfobjects::utils::getNodeType(), pdfobjects::utils::getNodeType(), pdfobjects::utils::getPageTreeRoot(), pdfobjects::utils::getReferencedObject(), TestCPdf::indirectPropertyTC(), TestCPdf::indirectPropertyTC(), TestCPdf::indirectPropertyTC(), TestCPdf::indirectPropertyTC(), pdfobjects::utils::isNodeDescendant(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeRootObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeNodeObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), pdfobjects::CPdf::PageTreeKidsObserver::notify(), TestCPdf::pageManipulationTC(), pdfobjects::CPdf::registerPageTreeObservers(), pdfobjects::CPdf::registerPageTreeObservers(), pdfobjects::CPdf::registerPageTreeObservers(), pdfobjects::CPdf::registerPageTreeObservers(), pdfobjects::utils::searchTreeNode(), pdfobjects::utils::searchTreeNode(), pdfobjects::CPdf::subsReferencies(), pdfobjects::CPdf::unregisterPageObservers(), pdfobjects::CPdf::unregisterPageTreeObservers(), pdfobjects::CPdf::unregisterPageTreeObservers(), pdfobjects::CPdf::unregisterPageTreeObservers(), and pdfobjects::CPdf::unregisterPageTreeObservers().

bool pdfobjects::isRefValid ( const IndiRef *  ref)
inline

Checks whether given indirect reference is valid. Reference is valid, if it is non NULL and object number is greater than 0 and object number is not invalid.

Parameters
refReference to check.
Returns
true if reference is valid, false otherwise.

Definition at line 338 of file iproperty.h.

References pdfobjects::IndiRef::invalidnum, pdfobjects::IndiRef::num, and pdfobjects::IndiRef::num.

Referenced by add_ref(), pdfobjects::CPdf::addIndirectProperty(), createMapping(), hasValidRef(), hasValidRef(), main(), main(), main(), and pdfobjects::CPdf::subsReferencies().

bool pdfobjects::isSimpleOp ( const StateUpdater::CheckTypes &  chck)
inline

Is it a simple or a composite operator.

Parameters
chckCheck type structure.
Returns
True if the chck is a simple operator, false otherwise.

Definition at line 225 of file stateupdater.h.

References pdfobjects::StateUpdater::CheckTypes::endTag.

Referenced by createOperator().

template<typename T >
bool pdfobjects::isStream ( T &  ip)
inline

Is IProperty of specified type.

Definition at line 373 of file iproperty.h.

Referenced by getStringRepresentation(), getTestStreamContent(), and pdfobjects::CPdf::subsReferencies().

template<typename T >
bool pdfobjects::isString ( T &  ip)
inline
bool pdfobjects::isTextOp ( const StateUpdater::CheckTypes &  chck)
inline

Is it a text operator (one which holds text to be displayed).

Parameters
chckCheck type structure.
Returns
True if chck is a text operator, false otherwise.

Definition at line 233 of file stateupdater.h.

References pdfobjects::StateUpdater::CheckTypes::name, pdfobjects::StateUpdater::CheckTypes::name, pdfobjects::StateUpdater::CheckTypes::name, and pdfobjects::StateUpdater::CheckTypes::name.

Referenced by createOperator().

std::ostream& pdfobjects::operator<< ( std::ostream &  out,
const IndiRef &  ref 
)
inline

Prints reference. Prints given reference according to pdf specification.

Parameters
outString where to print.
refReference to print.
Returns
reference to given string.

Definition at line 99 of file indiref.h.

References pdfobjects::IndiRef::gen, and pdfobjects::IndiRef::num.

std::ostream& pdfobjects::operator<< ( std::ostream &  out,
const ::Ref ref 
)
inline

Prints reference. Prints given xpdf reference in ref[num, gen] format.

Parameters
outString where to print.
refReference to print.
Returns
reference to given string.

Definition at line 115 of file indiref.h.

std::ostream & pdfobjects::operator<< ( std::ostream &  out,
PropertyType  type 
)

Prints property type.

Prints given type in human readable from instead of just number. Uses getStringType method to get string representation.

Parameters
outString where to print.
typeType to print.
Returns
Reference to given string.

Definition at line 131 of file iproperty.cc.

References pArray, pBool, pDict, pInt, pName, pNull, pOther, pOther1, pOther2, pOther3, pReal, pRef, pStream, and pString.

std::ostream & pdfobjects::operator<< ( std::ostream &  out,
::ObjType  type 
)

Prints xpdf object type.

Prints given type in human readable from instead of just number. Uses getStringType method to get string representation.

Parameters
outString where to print.
typeXpdf type to print.
Returns
Reference to given string.

Definition at line 185 of file iproperty.cc.

References objArray, objBool, objCmd, objDict, objEOF, objError, objInt, objName, objNone, objNull, objReal, objRef, objStream, and objString.

void pdfobjects::removeResolveRefMapping ( const cpdf_id_t &  orignalId,
ResolvedRefMapping &  map,
const cpdf_id_t &  id 
)

Removes entry for given id from mapping.

Parameters
originalIdId for cpdf owning map.
mapResolve mapping.
idPDF id.

Removes mapping entry for given id and deallocates associated resolve storage.

Definition at line 1736 of file cpdf.cc.

References deleteResolveRefStorage(), and utilsPrintDbg.

Referenced by pdfobjects::CPdf::releasePdfId().

Variable Documentation

const int pdfobjects::MAXOBJGEN = 65535

Maximal object generation number.

Cross reference entry with this generation number can't be reused.

Definition at line 46 of file cxref.h.

Referenced by pdfobjects::CXref::reserveRef().

const int pdfobjects::MAXOBJNUM = INT_MAX

Maximal object number.

Definition at line 40 of file cxref.h.

Referenced by pdfobjects::CXref::reserveRef(), and pdfobjects::CXref::reserveRef().