PDFix SDK  7.2.0
Loading...
Searching...
No Matches
PdsPageObject Struct Referenceabstract

PdsPageObject class. More...

#include <pdfix.h>

Inheritance diagram for PdsPageObject:
PdsForm PdsImage PdsPath PdsShading PdsText

Public Member Functions

virtual PdfPageObjectType GetObjectType () const =0
 Gets the type of an object. More...
 
virtual void GetBBox (PdfRect *bbox) const =0
 
virtual void GetQuad (PdfQuad *quad) const =0
 
virtual int GetId ()=0
 Gets the ordinal number of a page object. More...
 
virtual int GetStateFlags () const =0
 Get the object state flags. More...
 
virtual bool SetStateFlags (PdfStateFlags flags)=0
 Set the object state flags. More...
 
virtual PdsObjectGetStructObject (bool struct_parent)=0
 
virtual PdsContentMarkGetContentMark ()=0
 
virtual int GetMcid ()=0
 Gets content mark ID for this object or -1 if the object does not have MCID property. More...
 
virtual bool RemoveTags (PdfContentMarkFlags flags)=0
 
virtual PdfPageGetPage ()=0
 Gets a reference to the page on which the object is present. More...
 
virtual int GetContentStreamIndex ()=0
 
virtual PdsContentGetParentContent ()=0
 Gets a reference to the content in which the object is present. More...
 
virtual bool GetGState (PdfGraphicState *g_state)=0
 Gets the graphic state of the page object. More...
 
virtual bool SetGState (const PdfGraphicState *g_state)=0
 
virtual bool TransformCTM (const PdfMatrix *matrix)=0
 
virtual bool MoveToObject (PdsPageObject *ref_obj, bool after, int dst_tag_index, int obj_tag_index)=0
 Moves object within a content to another position. More...
 
virtual bool MoveToContent (PdsContent *content, int index)=0
 Moves object to another content. More...
 
virtual PdsPageObjectCopyToContent (PdsContent *content, int index)=0
 Copies object to another content. More...
 
virtual PdfDocGetDoc ()=0
 Gets a reference to a document object. More...
 
virtual int GetNumEqualTags (PdsPageObject *object)=0
 Count the number of different tags within the marked content of the two page objects. More...
 
virtual int GetOperatorId ()=0
 Get the operator index which construcs the object in the page content. More...
 
virtual int GetContentId ()=0
 Get the content index which identifies it within the tagged or untagged content. More...
 
virtual int GetNumContentItemIds ()=0
 Get the number of content item identifiers within all marked contents. More...
 
virtual int GetContentItemId (int level)=0
 
virtual bool RegisterEvent (PdfEventType type, PdsPageObjectEventProc proc, void *data)=0
 Registers a user-supplied procedure to call when the specified event occurs. More...
 
virtual bool UnregisterEvent (PdfEventType type, PdsPageObjectEventProc proc, void *data)=0
 

Detailed Description

PdsPageObject class.

A PdsPageObject is a general object in a PDF page content, which may be of any PdsPageObject object type. The Object layer provides several methods that are not specific to any particular object.

Member Function Documentation

◆ CopyToContent()

virtual PdsPageObject * PdsPageObject::CopyToContent ( PdsContent content,
int  index 
)
pure virtual

Copies object to another content.

Parameters
matrixA pointer to a PdfMatrix structure
indexA index where to put a new element into the content.
Returns
newly created page object

◆ GetBBox()

virtual void PdsPageObject::GetBBox ( PdfRect bbox) const
pure virtual

Gets the bounding box for an element in user space coordinates. To avoid the device-dependent effects of specifying objects in device space, PDF defines a device-independent coordinate system that always bears the same relationship to the current page, regardless of the output device on which printing or displaying occurs. This device-independent coordinate system is called user space. The origin of the user space(0, 0) represents the bottom-left corner of the PDF page. PDF files specify 72 points to 1 physical inch. The returned bounding box is guaranteed to encompass the element.

Parameters
bbox(Filled by the method) A pointer to a PdfRect structure specifying the bounding box of an element, specified in user space coordinates.

◆ GetContentId()

virtual int PdsPageObject::GetContentId ( )
pure virtual

Get the content index which identifies it within the tagged or untagged content.

Returns
the index of the operator

◆ GetContentItemId()

virtual int PdsPageObject::GetContentItemId ( int  level)
pure virtual

Get the content item index which identifies the object within the current marked content container

Returns
the index of the operator

◆ GetContentMark()

virtual PdsContentMark * PdsPageObject::GetContentMark ( )
pure virtual

Gets content mark for this object. It always return a content mark object even it's empty an has no tags.

Returns
PdsContentMark object corresponding to this object.
See also
PdsContentMark::GetNumTags

◆ GetContentStreamIndex()

virtual int PdsPageObject::GetContentStreamIndex ( )
pure virtual

Gets an index of the page content stream from which was parset or -1 if the object was created after parsing

Returns
page content stream index.

◆ GetDoc()

virtual PdfDoc * PdsPageObject::GetDoc ( )
pure virtual

Gets a reference to a document object.

Returns
PdfDoc object.

◆ GetGState()

virtual bool PdsPageObject::GetGState ( PdfGraphicState g_state)
pure virtual

Gets the graphic state of the page object.

Parameters
g_state(filled by method) A pointer to a PdfGraphicState structure specifying the graphic state of the page object.
Returns
true if the graphic state was successfully retrieved. false otherwise

◆ GetId()

virtual int PdsPageObject::GetId ( )
pure virtual

Gets the ordinal number of a page object.

Returns
Object identifier.

◆ GetMcid()

virtual int PdsPageObject::GetMcid ( )
pure virtual

Gets content mark ID for this object or -1 if the object does not have MCID property.

Returns
the content mark ID
See also
PdsContentMark::GetContentMark

◆ GetNumContentItemIds()

virtual int PdsPageObject::GetNumContentItemIds ( )
pure virtual

Get the number of content item identifiers within all marked contents.

Returns
the index of the operator

◆ GetNumEqualTags()

virtual int PdsPageObject::GetNumEqualTags ( PdsPageObject object)
pure virtual

Count the number of different tags within the marked content of the two page objects.

Parameters
objpointer to the other PdsPageObject
Returns
the number of different tags

◆ GetObjectType()

virtual PdfPageObjectType PdsPageObject::GetObjectType ( ) const
pure virtual

Gets the type of an object.

Returns
Object type, kObjectUnknown otherwise.

◆ GetOperatorId()

virtual int PdsPageObject::GetOperatorId ( )
pure virtual

Get the operator index which construcs the object in the page content.

Returns
the index of the operator

◆ GetPage()

virtual PdfPage * PdsPageObject::GetPage ( )
pure virtual

Gets a reference to the page on which the object is present.

Returns
PdfPage object.

◆ GetParentContent()

virtual PdsContent * PdsPageObject::GetParentContent ( )
pure virtual

Gets a reference to the content in which the object is present.

Returns
PdsContent object.

◆ GetQuad()

virtual void PdsPageObject::GetQuad ( PdfQuad quad) const
pure virtual

Gets the quad for an element in user space coordinates. See GetBBox for more info. The returned quad is guaranteed to encompass the element.

Parameters
quad(Filled by the method) A pointer to a PdfQuad structure specifying the bounding quad of an element, specified in user space coordinates.

◆ GetStateFlags()

virtual int PdsPageObject::GetStateFlags ( ) const
pure virtual

Get the object state flags.

Returns
the object state flags as PdfStateFlags.

◆ GetStructObject()

virtual PdsObject * PdsPageObject::GetStructObject ( bool  struct_parent)
pure virtual

Gets the corresponding struct element object from the document structure tree. Iterates hierarchy of objects from the structure tree. If there is a reference to the current page object, a structure element object with this reference is returned.

Parameters
struct_parentIf set to true, ParentTree is used in finding the structure element to which the page object belongs.
Returns
PdsObject object corresponding to the found structure element, otherwise nullptr.
See also
PdsStructTree::GetStructElementFromObject

◆ MoveToContent()

virtual bool PdsPageObject::MoveToContent ( PdsContent content,
int  index 
)
pure virtual

Moves object to another content.

Parameters
contentA pointer to a PdsContent structure
indexA index where to put a new element into the content.
Returns
true if successfull, false otherwise

◆ MoveToObject()

virtual bool PdsPageObject::MoveToObject ( PdsPageObject ref_obj,
bool  after,
int  dst_tag_index,
int  obj_tag_index 
)
pure virtual

Moves object within a content to another position.

Parameters
ref_objA pointer to a PdsPageObject which is a reference object to move the object to
afterIf true the object is moved after the reference object, false othervise
dst_tag_indexA index of the last marked content tag of the reference object, which will be applied to the object
obj_tag_indexA index of the first marked content tag of the object, which will ramain set in the object marked content
Returns
true if successfull, false otherwise

◆ RegisterEvent()

virtual bool PdsPageObject::RegisterEvent ( PdfEventType  type,
PdsPageObjectEventProc  proc,
void *  data 
)
pure virtual

Registers a user-supplied procedure to call when the specified event occurs.

Parameters
typeThe event type.
procA user-supplied callback to call when the event occurs.
dataA pointer to user-supplied data to pass to proc each time it is called.
Returns
true if event was registered, false otherwise. Sample RegisterEvent

◆ RemoveTags()

virtual bool PdsPageObject::RemoveTags ( PdfContentMarkFlags  flags)
pure virtual

Remove pbject marked content tags. Method removes for example all content marks, artifact tag or mcid property

Parameters
flagsthe PdfContentMarkFlags flags to be used
Returns
the content mark ID
See also
PdsContentMark::GetContentMark

◆ SetGState()

virtual bool PdsPageObject::SetGState ( const PdfGraphicState g_state)
pure virtual

Sets the graphics state information for the page object. This method is valid only for PdsForm, PdsImage, PdsPath, and PdsShading objects.

Parameters
g_stateA pointer to a PdfGraphicState structure with graphics state information to set for the page object
Returns
true if the graphic state was successfully set. false otherwise

◆ SetStateFlags()

virtual bool PdsPageObject::SetStateFlags ( PdfStateFlags  flags)
pure virtual

Set the object state flags.

Parameters
flagsthe PdfStateFlags flags to be set
Returns
true if the object's state flags was set false otherwise

◆ TransformCTM()

virtual bool PdsPageObject::TransformCTM ( const PdfMatrix matrix)
pure virtual

Sets the transformation matrix for the page object. This method is valid only for PdsImage object.

Parameters
matrixA pointer to a PdfMatrix structure
Returns
true if the transformation matrix was successfully set. false otherwise

◆ UnregisterEvent()

virtual bool PdsPageObject::UnregisterEvent ( PdfEventType  type,
PdsPageObjectEventProc  proc,
void *  data 
)
pure virtual

Unregisters a user-supplied procedure to call when the specified event occurs. To un-register, you must use same type, proc and data that were used when the event was registered using Pdfix::RegisterEvent.

Parameters
typeThe registered event type.
procA registered user-supplied callback.
dataA pointer to registered user-supplied data.
Returns
true if event was registered, false otherwise.