Foxit PDF SDK

Public Member Functions | List of all members
foxit::pdf::graphics::MarkedContent Class Reference

Inherits Object.

## Public Member Functions
| ~MarkedContent ()
| Destructor.
int | AddItem (const char *tag_name, objects::PDFDictionary *property_dict=0)
| Add a new marked content item. More...
int | GetItemCount () const
| Get the count of marked content items. More...
int | GetItemMCID (int index) const
| Get marked-content identifier (MCID) of a marked content item specified by index. More...
objects::PDFDictionary * | GetItemPropertyDict (int index) const
| Get the property dictionary of a marked content item specified by index. More...
String | GetItemTagName (int index) const
| Get the tag name of a marked content item specified by index. More...
bool | HasTag (const char *tag_name)
| Check whether current marked content object has a specified marked content item or not. More...
bool | RemoveItem (const char *tag_name)
| Remove a marked content item by tag name. More...

## Detailed Description

Marked-content operators (PDF 1.2) identify a portion of a PDF content stream as a marked-content element of interest to a particular application or PDF plug-in extension. For more details, please refer to Section 10.5 "Marked Content" in <PDF Reference 1.7>.
To get a marked content object, please use function GraphicsObject::GetMarkedContent.

See also
  GraphicsObject

## Member Function Documentation

## ◆ AddItem()

int foxit::pdf::graphics::MarkedContent::AddItem | ( | const char * | tag_name,
|  | objects::PDFDictionary * | property_dict = `0`
| ) |  |

Add a new marked content item.

Parameters

  [in] | tag_name | New tag name. It should not be an empty string. If parameter tag_name exists in current marked content object, it cannot be added to current marked content object again.
  [in] | property_dict | A property dictionary. Default value: NULL. NULL means the new marked content item will not have a property dictionary. If this dictionary is newly created and not set to other object yet, user should release this dictionary object after calling this function.

Returns
  The index of the newly added marked content item. If there is any error, this function will return -1.

## ◆ GetItemCount()

int foxit::pdf::graphics::MarkedContent::GetItemCount | ( |  | ) | const

Get the count of marked content items.

A marked content object may be nested one within another, and this function is used to get the count of marked content items in the current marked content sequence.

Returns
  The count of marked content items.

## ◆ GetItemMCID()

int foxit::pdf::graphics::MarkedContent::GetItemMCID | ( | int | index | ) | const

Get marked-content identifier (MCID) of a marked content item specified by index.

Parameters

  [in] | index | Item index. Valid range: from 0 to (count-1). count is returned by function MarkedContent::GetItemCount.

Returns
  The MCID value. A negative number means that the specified marked content item does not have a MCID.

## ◆ GetItemPropertyDict()

objects::PDFDictionary* foxit::pdf::graphics::MarkedContent::GetItemPropertyDict | ( | int | index | ) | const

Get the property dictionary of a marked content item specified by index.

Parameters

  [in] | index | Item index. Valid range: from 0 to (count-1). count is returned by function MarkedContent::GetItemCount.

Returns
  The property dictionary. NULL means no property dictionary.

## ◆ GetItemTagName()

String foxit::pdf::graphics::MarkedContent::GetItemTagName | ( | int | index | ) | const

Get the tag name of a marked content item specified by index.

A marked content object may be nested one within another, and this function is used to get the count of marked content items in the current marked content sequence.

Parameters

  [in] | index | Item index. Valid range: from 0 to (count-1). count is returned by function MarkedContent::GetItemCount.

Returns
  The tag name.

## ◆ HasTag()

bool foxit::pdf::graphics::MarkedContent::HasTag | ( | const char * | tag_name | ) |

Check whether current marked content object has a specified marked content item or not.

Parameters

  [in] | tag_name | The tag name to be checked.

Returns
  true means current marked content object has the specified marked content item. false means current marked content object does not have the specified marked content item.

## ◆ RemoveItem()

bool foxit::pdf::graphics::MarkedContent::RemoveItem | ( | const char * | tag_name | ) |

Remove a marked content item by tag name.

Parameters

  [in] | tag_name | Tag name. It should not be an empty string.

Returns
  true means success, while false means failure.