PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
PDF::Content Class Reference

Represents a content array. More...

#include <pdfsdk/cxx/content.h>

Inheritance diagram for PDF::Content:

Public Member Functions

size_t GetNumElements () const
 Gets the number of elements in a content array.
 
Element GetElement (size_t index) const
 Gets the element at the specified index in the content array.
 
void InsertElement (size_t index, const Element &element)
 Inserts an element at the specified index inside the element array.
 
void AppendElement (const Element &element)
 Appends an element to the end of the content array.
 
void RemoveElement (size_t index)
 Removes the element at the specified index.
 
 Content (PDEContent handle, bool adopt=false) noexcept
 
 Content (const Content &rhs) noexcept
 
Contentoperator= (const Content &rhs) noexcept
 
 Content (Content &&rhs) noexcept
 
Contentoperator= (Content &&rhs) noexcept
 

Static Public Member Functions

static Content Create ()
 Creates a new instance of a Content class.
 

Detailed Description

Represents a content array.

This class provides methods to manipulate the elements that make up the content array. When content objects are arranged in a tree structure and serialized - they create the content stream. The content stream consists of a sequence of instructions that describe the 8 element types

See also
PDEElementType. Five of the elements are the graphical elements (path, text, external, inline and shading). There are also the Place element
kPDEElementPlace, which represents the MP and DP marked-content operators and the Container element
kPDEElementContainer, which represents the other marked-content operators BMC and BDC. The content stream together with the page dictionary define a PDF page.

For more information refer to ISO 32000-2:2020 - 7.8.2 Content streams, 8.2 Graphics objects, 14.6 Marked content

Member Function Documentation

◆ AppendElement()

void PDF::Content::AppendElement ( const Element & element)

Appends an element to the end of the content array.

Parameters
elementThe element to append to the content array.
See also
Element

◆ Create()

static Content PDF::Content::Create ( )
static

Creates a new instance of a Content class.

Returns
The newly created Content object.

◆ GetElement()

Element PDF::Content::GetElement ( size_t index) const

Gets the element at the specified index in the content array.

Parameters
indexThe index of the element to retrieve.
Returns
The element at the specified index.
See also
Element

◆ GetNumElements()

size_t PDF::Content::GetNumElements ( ) const

Gets the number of elements in a content array.

Returns
The number of elements in the content array.

◆ InsertElement()

void PDF::Content::InsertElement ( size_t index,
const Element & element )

Inserts an element at the specified index inside the element array.

Parameters
indexThe index at which to insert the element at.
elementThe element to insert.
See also
Element

◆ RemoveElement()

void PDF::Content::RemoveElement ( size_t index)

Removes the element at the specified index.

Parameters
indexThe index of the element to remove.

The documentation for this class was generated from the following file: