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

PdsContent class. More...

#include <pdfix.h>

Public Member Functions

virtual PdsTextAddNewText (int index, PdfFont *font, const PdfMatrix *matrix)=0
 Creates and inserts a text object. More...
 
virtual PdsPathAddNewPath (int index, const PdfMatrix *matrix)=0
 Creates and inserts an path object. More...
 
virtual PdsImageAddNewImage (int index, PdsStream *image_xobj, const PdfMatrix *matrix)=0
 
virtual PdsFormAddNewForm (int index, PdsStream *form_xobj, const PdfMatrix *matrix)=0
 
virtual bool RemoveObject (PdsPageObject *object)=0
 Removes an object from a PdsContent. More...
 
virtual int GetNumObjects () const =0
 Gets the number of objects. More...
 
virtual PdsPageObjectGetObject (int index)=0
 
virtual PdsStreamToObject (PdfDoc *doc, const PdsContentParams *content_params)=0
 This is the main method for converting a PdsContent into PDF contents and resources. More...
 
virtual PdfPageGetPage ()=0
 Get the page from which the content is parsser. More...
 
virtual PdsFormGetForm ()=0
 Get the page from which the content is parsser. More...
 
virtual bool RegisterEvent (PdfEventType type, PdsContentEventProc proc, void *data)=0
 Registers a user-supplied procedure to call when the specified event occurs. More...
 
virtual bool UnregisterEvent (PdfEventType type, PdsContentEventProc proc, void *data)=0
 

Detailed Description

PdsContent class.

The PdsContent object is contains the modifiable contents of a PdfPage.

A PdsContent 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

◆ AddNewForm()

virtual PdsForm * PdsContent::AddNewForm ( int  index,
PdsStream form_xobj,
const PdfMatrix matrix 
)
pure virtual

Creates and inserts an form XObject object. The form data are to be specified as a stream.

Parameters
indexA place where to insert new object into the content. Passing a value of kInsertAfterLast adds the object to the end. Passing a value of kInsertBeforeFirst adds the object to the beginning of the content.
form_xobjThe form XObject.
matrixA pointer to a PdfMatrix structure
Returns
The created PdsImage.

◆ AddNewImage()

virtual PdsImage * PdsContent::AddNewImage ( int  index,
PdsStream image_xobj,
const PdfMatrix matrix 
)
pure virtual

Creates and inserts an image object. The image data are to be specified as a stream.

Parameters
indexA place where to insert new object into the content. Passing a value of kInsertAfterLast adds the object to the end. Passing a value of kInsertBeforeFirst adds the object to the beginning of the content.
image_xobjThe image XObject created with CreateXObjectFromImage.
matrixA pointer to a PdfMatrix structure
Returns
The created PdsImage.

◆ AddNewPath()

virtual PdsPath * PdsContent::AddNewPath ( int  index,
const PdfMatrix matrix 
)
pure virtual

Creates and inserts an path object.

Parameters
indexA place where to insert new object into the content. Passing a value of kInsertAfterLast adds the object to the end. Passing a value of kInsertBeforeFirst adds the object to the beginning of the content.
matrixA pointer to a PdfMatrix structure
Returns
The created PdsPath.

◆ AddNewText()

virtual PdsText * PdsContent::AddNewText ( int  index,
PdfFont font,
const PdfMatrix matrix 
)
pure virtual

Creates and inserts a text object.

Parameters
indexA place where to insert new object into the content. Passing a value of kInsertAfterLast adds the object to the end. Passing a value of kInsertBeforeFirst adds the object to the beginning of the content.
fontFont of the text. If font is null, default font (Helvetica) is used.
matrixText transformation matrix
Returns
The created PdsText.

◆ GetForm()

virtual PdsForm * PdsContent::GetForm ( )
pure virtual

Get the page from which the content is parsser.

Returns
PdsForm object or null if the content was parsed from a page.

◆ GetNumObjects()

virtual int PdsContent::GetNumObjects ( ) const
pure virtual

Gets the number of objects.

Returns
Number of page objects in the content.

◆ GetObject()

virtual PdsPageObject * PdsContent::GetObject ( int  index)
pure virtual

Gets the requested object from a content. NOTE: This method does not copy the object.

Parameters
indexIndex of object to obtain.
Returns
The requested object.

◆ GetPage()

virtual PdfPage * PdsContent::GetPage ( )
pure virtual

Get the page from which the content is parsser.

Returns
PdfPage object or null if the content was parsed from an XObject.

◆ RegisterEvent()

virtual bool PdsContent::RegisterEvent ( PdfEventType  type,
PdsContentEventProc  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

◆ RemoveObject()

virtual bool PdsContent::RemoveObject ( PdsPageObject object)
pure virtual

Removes an object from a PdsContent.

Returns
true if the operation was successful, false otherwise.

◆ ToObject()

virtual PdsStream * PdsContent::ToObject ( PdfDoc doc,
const PdsContentParams content_params 
)
pure virtual

This is the main method for converting a PdsContent into PDF contents and resources.

Returns
PdsStream for the resulting contents in PdsContent.

◆ UnregisterEvent()

virtual bool PdsContent::UnregisterEvent ( PdfEventType  type,
PdsContentEventProc  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.