PDF SDK Documentation

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

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

Represents a leaf node (Page Object). More...

#include <pdfsdk/cxx/page.h>

Inheritance diagram for PDF::Page:

Public Member Functions

Object GetPdfObject () const
 
Content GetContent () const
 
bool IsContentModified () const
 Get the content modified flag.
 
void SetContentModified (bool modified=true)
 Set the content modified flag.
 
void FlushModifiedContent ()
 
size_t GetPageIndex () const
 
PDRotate GetRotate () const
 
void SetRotate (PDRotate rotate)
 
RectF GetCropBox () const
 
void SetCropBox (const RectF &box)
 
RectF GetMediaBox () const
 
void SetMediaBox (const PDF::RectF &box)
 
RectF GetArtBox () const
 
void SetArtBox (const RectF &box)
 
RectF GetBleedBox () const
 
void SetBleedBox (const RectF &box)
 
RectF GetTrimBox () const
 
void SetTrimBox (const RectF &box)
 
RectF GetPageBox () const
 
float GetUserUnitSize () const
 
void SetUserUnitSize (float unitSize)
 
Matrix GetPageToDevSpaceMatrix (float zoom=1.f, PDRotate rotate=kPDRotate_0, float dpi=96) const
 
Matrix GetDevToPageSpaceMatrix (float zoom=1.f, PDRotate rotate=kPDRotate_0, float dpi=96) const
 
RectF GetDevSpacePageBox (float zoom=1.f, PDRotate rotate=kPDRotate_0, float dpi=96) const
 
size_t GetNumAnnots () const
 
Annot GetAnnot (size_t index) const
 
void AddAnnot (size_t insertAt, Annot annot)
 
void RemoveAnnot (Annot annot)
 
void RemoveAnnotByIndex (size_t index)
 
size_t GetAnnotIndex (Annot annot) const
 
PageText GetPageText () const
 
Document GetDocument () const
 
 Page (PDPage handle, bool adopt=false) noexcept
 
 Page (const Page &rhs) noexcept
 
Pageoperator= (const Page &rhs) noexcept
 
 Page (Page &&rhs) noexcept
 
Pageoperator= (Page &&rhs) noexcept
 

Detailed Description

Represents a leaf node (Page Object).

For more information refer to the ISO 32000-2:2020 (PDF 2.0) PDF Standard section 7.7.3 Page tree.

Member Function Documentation

◆ AddAnnot()

void PDF::Page::AddAnnot ( size_t insertAt,
Annot annot )

Add an annotation at the specified index.

Parameters
insertAtThe index to insert the annotation.
annotThe annotation to add.

◆ FlushModifiedContent()

void PDF::Page::FlushModifiedContent ( )

Saves the contents of the page to a PDF stream.

Warning
Call this function only then you are 100% sure that all content handles are released. Otherwise, it will cause UB and will probably crash the application.

◆ GetAnnot()

Annot PDF::Page::GetAnnot ( size_t index) const

Get the annotation at the specified index.

Parameters
indexThe index of the annotation.
Returns
The annotation.

◆ GetAnnotIndex()

size_t PDF::Page::GetAnnotIndex ( Annot annot) const

Get the index of the specified annotation.

Parameters
annotThe annotation.
Returns
The index of the annotation.

◆ GetArtBox()

RectF PDF::Page::GetArtBox ( ) const

Get the art box of the page.

Returns
The art box of the page.

◆ GetBleedBox()

RectF PDF::Page::GetBleedBox ( ) const

Get the bleed box of the page.

Returns
The bleed box of the page.

◆ GetContent()

Content PDF::Page::GetContent ( ) const

Get the content of this page.

Returns
The content of the page.

◆ GetCropBox()

RectF PDF::Page::GetCropBox ( ) const

Get the crop box of the page.

Returns
The crop box of the page.

◆ GetDevSpacePageBox()

RectF PDF::Page::GetDevSpacePageBox ( float zoom = 1.f,
PDRotate rotate = kPDRotate_0,
float dpi = 96 ) const

Get the page box in device space.

Parameters
zoomThe zoom factor.
rotateThe rotation value.
dpiThe DPI value.
Returns
The page box in device space.

◆ GetDevToPageSpaceMatrix()

Matrix PDF::Page::GetDevToPageSpaceMatrix ( float zoom = 1.f,
PDRotate rotate = kPDRotate_0,
float dpi = 96 ) const

Get the transformation matrix from device space to page space.

Parameters
zoomThe zoom factor.
rotateThe rotation value.
dpiThe DPI value.
Returns
The transformation matrix.

◆ GetDocument()

Document PDF::Page::GetDocument ( ) const

Get the document that contains the page.

Returns
The document.

◆ GetMediaBox()

RectF PDF::Page::GetMediaBox ( ) const

Get the media box of the page.

Returns
The media box of the page.

◆ GetNumAnnots()

size_t PDF::Page::GetNumAnnots ( ) const

Get the number of annotations in the page.

Returns
The number of annotations.

◆ GetPageBox()

RectF PDF::Page::GetPageBox ( ) const

Get the page box of the page.

Returns
The page box of the page.

◆ GetPageIndex()

size_t PDF::Page::GetPageIndex ( ) const

Get the index of this page in the document.

Returns
The index of the page.

◆ GetPageText()

PageText PDF::Page::GetPageText ( ) const

Get the text content of the page.

Returns
The text content of the page.

◆ GetPageToDevSpaceMatrix()

Matrix PDF::Page::GetPageToDevSpaceMatrix ( float zoom = 1.f,
PDRotate rotate = kPDRotate_0,
float dpi = 96 ) const

Get the transformation matrix from page space to device space.

Parameters
zoomThe zoom factor.
rotateThe rotation value.
dpiThe DPI value.
Returns
The transformation matrix.

◆ GetPdfObject()

Object PDF::Page::GetPdfObject ( ) const

Get the PDF object associated with this page.

Returns
The PDF object.

◆ GetRotate()

PDRotate PDF::Page::GetRotate ( ) const

Get the rotation of the page.

Returns
The rotation of the page.

◆ GetTrimBox()

RectF PDF::Page::GetTrimBox ( ) const

Get the trim box of the page.

Returns
The trim box of the page.

◆ GetUserUnitSize()

float PDF::Page::GetUserUnitSize ( ) const

Get the user unit size of the page.

Returns
The user unit size of the page.

◆ IsContentModified()

bool PDF::Page::IsContentModified ( ) const

Get the content modified flag.

Returns
The value of the content modified flag.

◆ RemoveAnnot()

void PDF::Page::RemoveAnnot ( Annot annot)

Remove the specified annotation.

Parameters
annotThe annotation to remove.

◆ RemoveAnnotByIndex()

void PDF::Page::RemoveAnnotByIndex ( size_t index)

Remove the annotation at the specified index.

Parameters
indexThe index of the annotation to remove.

◆ SetArtBox()

void PDF::Page::SetArtBox ( const RectF & box)

Set the art box of the page.

Parameters
boxThe art box value.

◆ SetBleedBox()

void PDF::Page::SetBleedBox ( const RectF & box)

Set the bleed box of the page.

Parameters
boxThe bleed box value.

◆ SetContentModified()

void PDF::Page::SetContentModified ( bool modified = true)

Set the content modified flag.

Parameters
modifiedThe value of the content modified flag.

◆ SetCropBox()

void PDF::Page::SetCropBox ( const RectF & box)

Set the crop box of the page.

Parameters
boxThe crop box value.

◆ SetMediaBox()

void PDF::Page::SetMediaBox ( const PDF::RectF & box)

Set the media box of the page.

Parameters
boxThe media box value.

◆ SetRotate()

void PDF::Page::SetRotate ( PDRotate rotate)

Set the rotation of the page.

Parameters
rotateThe rotation value.

◆ SetTrimBox()

void PDF::Page::SetTrimBox ( const RectF & box)

Set the trim box of the page.

Parameters
boxThe trim box value.

◆ SetUserUnitSize()

void PDF::Page::SetUserUnitSize ( float unitSize)

Set the user unit size of the page.

Parameters
unitSizeThe user unit size value.

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