foxit::pdf::graphics::FormXObject Class Reference
Inheritance diagram for foxit::pdf::graphics::FormXObject:
foxit::pdf::graphics::GraphicsObject

Public Member Functions

GraphicsObjects GetGraphicsObjects () const
 Get graphics objects that associated with current form XObject. More...
 
objects::PDFStreamGetStream () const
 Get stream. More...
 
bool ImportPageContent (const PDFPage &source_page, bool is_annots_included)
 Import page content from a specified PDF page to current form XObject. More...
 
- Public Member Functions inherited from foxit::pdf::graphics::GraphicsObject
bool AddClipPath (const common::Path &path, common::FillMode fill_mode)
 Add a path for clipping. More...
 
bool AddClipTextObject (TextObject *textobject)
 Add text object for clipping. More...
 
bool ClearClips ()
 Clear all clips. More...
 
GraphicsObjectClone ()
 Clone a new graphics object. More...
 
BlendMode GetBlendMode () const
 Get the blend mode for transparent imaging model. More...
 
common::Path GetClipPath (int index) const
 Get a path clip by index. More...
 
int GetClipPathCount () const
 Get the count of path clip. More...
 
common::FillMode GetClipPathFillMode (int index) const
 Get the fill mode of a path clip by index. More...
 
RectF GetClipRect () const
 Get clip rectangle. More...
 
TextObjectGetClipTextObject (int index) const
 Get the text object of a text clip by index. More...
 
int GetClipTextObjectCount () const
 Get the count of text clip. More...
 
ARGB GetFillColor () const
 Get the fill color. More...
 
FormXObjectGetFormXObject () const
 Get the form XObject object if current graphics object represents a form XObject object. More...
 
common::GraphState GetGraphState () const
 Get graph state. More...
 
ImageObjectGetImageObject () const
 Get the image object if current graphics object represents an image object. More...
 
LayerNodeArray GetLayers (const LayerTree &layer_tree)
 Get all the layers which are associated with current graphics object. More...
 
MarkedContentGetMarkedContent () const
 Get marked content object. More...
 
Matrix GetMatrix () const
 Get matrix. More...
 
PathObjectGetPathObject () const
 Get the path object if current graphics object represents a path object. More...
 
RectF GetRect () const
 Get the rectangle of current graphics object. More...
 
ShadingObjectGetShadingObject () const
 Get the shading object if current graphics object represents a shading object. More...
 
ARGB GetStrokeColor () const
 Get the stroke color. More...
 
TextObjectGetTextObject () const
 Get the text object if current graphics object represents a text object. More...
 
Type GetType () const
 Get the type of current graphics object. More...
 
bool HasTransparency ()
 Check whether current graphics object has transparency or not. More...
 
void Release ()
 Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More...
 
bool RemoveClipPath (int index)
 Remove a path clip by index. More...
 
bool RemoveClipTextObject (int index)
 Remove a text clip by index for clipping. More...
 
void SetBlendMode (BlendMode blend_mode)
 Set the blend mode for transparent imaging model. More...
 
void SetClipRect (const RectF &clip_rect)
 Set clip rectangle. More...
 
void SetFillColor (ARGB color)
 Set the fill color. More...
 
void SetGraphState (const common::GraphState &graph_state)
 Set graph state. More...
 
void SetMatrix (const Matrix &matrix)
 Set matrix. More...
 
void SetStrokeColor (ARGB color)
 Set the stroke color. More...
 
bool Transform (const Matrix &matrix, bool need_transform_clippath)
 Transform current graphics object. More...
 

Static Public Member Functions

static FormXObjectCreate (const PDFDoc &document)
 Create a new form XObject graphics object. More...
 

Additional Inherited Members

- Public Types inherited from foxit::pdf::graphics::GraphicsObject
enum  BlendMode {
  e_BlendNormal = 0, e_BlendMultiply = 1, e_BlendScreen = 2, e_BlendOverlay = 3,
  e_BlendDarken = 4, e_BlendLighten = 5, e_BlendColorDodge = 6, e_BlendColorBurn = 7,
  e_BlendHardlight = 8, e_BlendSoftlight = 9, e_BlendDifference = 10, e_BlendExclusion = 11,
  e_BlendHue = 21, e_BlendSaturation = 22, e_BlendColor = 23, e_BlendLuminosity = 24
}
 Enumeration for render blend mode. More...
 
enum  Type {
  e_TypeAll = 0, e_TypeText = 1, e_TypePath = 2, e_TypeImage = 3,
  e_TypeShading = 4, e_TypeFormXObject = 5
}
 Enumeration for PDF graphics object type. More...
 

Detailed Description

A form XObject is not only a graphics object, but also a container. A form XObject consists of a set of graphics objects or sub form XObjects. Form XObject is a kind of PDF graphics object, so class FormXObject is derived from class GraphicsObject. It offers functions to get/set form XObject's data.
To create a new form XObject graphics object, please use function PathObject::Create and then import page content to the new form XObject, or insert new graphics object to form XObject through GraphicsObjects object returned by function FormXObject::GetGraphicsObjects.

See also
GraphicsObject

Member Function Documentation

◆ Create()

static FormXObject* foxit::pdf::graphics::FormXObject::Create ( const PDFDoc document)
static

Create a new form XObject graphics object.

The newly created form XObject graphics object does not have any data yet. Then, setting functions can be called to set data to the new form XObject graphics object.

Parameters
[in]documentA valid PDF document object. The new form XObject graphics object should be inserted to one page of this PDF document then.
Returns
A new form XObject.
If the newly created form XObject will not inserted to any page or other objects, please remember to call function GraphicsObject::Release to release it when no use.

◆ GetGraphicsObjects()

GraphicsObjects foxit::pdf::graphics::FormXObject::GetGraphicsObjects ( ) const

Get graphics objects that associated with current form XObject.

Returns
A GraphicsObjects object.

◆ GetStream()

objects::PDFStream* foxit::pdf::graphics::FormXObject::GetStream ( ) const

Get stream.

Returns
A PDFStream that represents the stream data of current form XObject. If there is any error, this function will return NULL.

◆ ImportPageContent()

bool foxit::pdf::graphics::FormXObject::ImportPageContent ( const PDFPage source_page,
bool  is_annots_included 
)

Import page content from a specified PDF page to current form XObject.

If this function succeeds, the boundary box of current form XObject will be the same as page's size.

Parameters
[in]source_pageA valid PDF page object that represents the source PDF page whose content will be imported to current form XObject.
[in]is_annots_includedtrue means annotations should be included with the content of parameter source_page. false means annotations should be ignored from the content of parameter source_page.
Returns
true means success, while false means failure.
Note
When this function succeeds, function GraphicsObjects::GenerateContent should be called. Please refer to function GraphicsObjects::GenerateContent for more details.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.