PDF SDK Documentation

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

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

Represents a clipping path in a PDF document. More...

#include <pdfsdk/cxx/clip.h>

Inheritance diagram for PDF::Clip:

Public Member Functions

RectF GetBBox () const
 
size_t GetNumElements () const
 
Element GetElement (size_t index) const
 
void InsertElement (size_t index, const Element &element)
 
void AppendElement (const Element &element)
 
void RemoveElement (size_t index)
 
 Clip (PDEClip handle, bool adopt=false) noexcept
 
 Clip (const Clip &rhs) noexcept
 
Clipoperator= (const Clip &rhs) noexcept
 
 Clip (Clip &&rhs) noexcept
 
Clipoperator= (Clip &&rhs) noexcept
 

Detailed Description

Represents a clipping path in a PDF document.

Clipping is a graphical operation that defines a restricted area where content can be displayed, preventing anything outside that area from being rendered. The area that remains visible is defined by the clipping path. The clipping path is constructed from a combination of geometric and drawing elements that define its shape and boundaries. The content within the boundary (text, images, or graphics) will remain visible. Elements can be added to a clipping path to construct it or removed from an existing path to modify it. A document can have an unlimited number of clipping paths, as clipping paths are applied dynamically to specific graphical objects within the graphics state. Each object (text, image, or shape) can have its own clipping path, and the total number is only constrained by the size and complexity of the document.

For more information refer to section 8.5.4 Clipping path operators, from the ISO 32000-2:2020 (PDF 2.0) Standard.

Member Function Documentation

◆ AppendElement()

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

Append an element to the end of the clipping path.

Parameters
elementThe element to append.

◆ GetBBox()

RectF PDF::Clip::GetBBox ( ) const

Get the bounding box that contains a clipping path.

Returns
The bounding box containing the clipping path.

◆ GetElement()

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

Get the element at the specified index in the clipping path.

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

◆ GetNumElements()

size_t PDF::Clip::GetNumElements ( ) const

Get the number of elements in the clipping path.

Returns
The number of elements in the clipping path.

◆ InsertElement()

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

Insert an element at the specified index in the clipping path.

Parameters
indexThe index at which to insert the element.
elementThe element to insert.

◆ RemoveElement()

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

Remove an element at the specified index from the clipping path.

Parameters
indexThe index of the element to remove.

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