PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
PoDoFo::PdfPage Class Referencefinal

PdfPage is one page in the pdf document. More...

#include <PdfPage.h>

Inheritance diagram for PoDoFo::PdfPage:
PoDoFo::PdfCanvas

Public Member Functions

void ExtractTextTo (std::vector< PdfTextEntry > &entries, const PdfTextExtractParams &params) const
 
void ExtractTextTo (std::vector< PdfTextEntry > &entries, const std::string_view &pattern={ }, const PdfTextExtractParams &params={ }) const
 
Rect GetRect () const
 Get the rectangle of this page.
 
void SetRect (const Rect &rect)
 Set the rectangle of this annotation.
 
Corners GetRectRaw () const override
 Get the current canvas size in PDF Units.
 
void SetRectRaw (const Corners &rect)
 
bool TryGetRotationRadians (double &teta) const override
 Try getting the current canvas rotation.
 
double GetRotationRadians () const
 Get the current page rotation in radians.
 
void SetMediaBox (const Rect &rect)
 Set the /MediaBox in PDF Units.
 
void SetCropBox (const Rect &rect)
 Set the /CropBox in PDF Units.
 
void SetTrimBox (const Rect &rect)
 Set the /TrimBox in PDF Units.
 
void SetBleedBox (const Rect &rect)
 Set the /BleedBox in PDF Units.
 
void SetArtBox (const Rect &rect)
 Set the /ArtBox in PDF Units.
 
unsigned GetPageNumber () const
 Page number inside of the document.
 
Rect GetMediaBox () const
 Get the current MediaBox (physical page size) in PDF units.
 
Corners GetMediaBoxRaw () const
 
Rect GetCropBox () const
 Get the current CropBox (visible page size) in PDF units.
 
Corners GetCropBoxRaw () const
 
Rect GetTrimBox () const
 Get the current TrimBox (cut area) in PDF units.
 
Corners GetTrimBoxRaw () const
 
Rect GetBleedBox () const
 Get the current BleedBox (extra area for printing purposes) in PDF units.
 
Corners GetBleedBoxRaw () const
 
Rect GetArtBox () const
 Get the current ArtBox in PDF units.
 
Corners GetArtBoxRaw () const
 
unsigned GetRotation () const
 Get the normalized page rotation (0, 90, 180 or 270)
 
bool TryGetRotationRaw (double &rotation) const
 Get the raw page rotation (if any)
 
void SetRotation (int rotation)
 Set the current page rotation.
 
bool MoveTo (unsigned index)
 Move the page to the given index.
 
template<typename TField >
TFieldCreateField (const std::string_view &name, const Rect &rect)
 
PdfField & CreateField (const std::string_view &name, PdfFieldType fieldType, const Rect &rect)
 
PdfPageFieldIterable GetFieldsIterator ()
 Get an iterator for all fields in the page.
 
PdfPageConstFieldIterable GetFieldsIterator () const
 
unsigned GetIndex () const
 
PdfContentsGetOrCreateContents ()
 
const PdfContentsGetContents () const
 
PdfContentsGetContents ()
 
const PdfContentsMustGetContents () const
 
PdfContentsMustGetContents ()
 
const PdfResourcesGetResources () const
 
PdfResourcesGetResources ()
 
PdfAnnotationCollection & GetAnnotations ()
 
const PdfAnnotationCollection & GetAnnotations () const
 
- Public Member Functions inherited from PoDoFo::PdfCanvas
virtual ~PdfCanvas ()
 Virtual destructor to avoid compiler warnings.
 
const PdfObjectGetContentsObject () const
 Get access to the contents object of this page.
 
PdfObjectGetContentsObject ()
 
charbuff GetContentsCopy () const
 
void CopyContentsTo (charbuff &buffer) const
 
PdfResourcesGetResources ()
 Get the resource object of this page.
 
const PdfResourcesGetResources () const
 
PdfDictionaryElement & GetElement ()
 
const PdfDictionaryElement & GetElement () const
 
void EnsureResourcesCreated ()
 Ensure resources initialized on this canvas.
 

Static Public Member Functions

static Rect CreateStandardPageSize (const PdfPageSize pageSize, bool landscape=false)
 Creates a Rect with the page size as values which is needed to create a PdfPage object from an enum which are defined for a few standard page sizes.
 

Friends

class PdfPageCollection
 
class PdfDocument
 

Additional Inherited Members

Detailed Description

PdfPage is one page in the pdf document.

It is possible to draw on a page using a PdfPainter object. Every document needs at least one page.

Member Function Documentation

◆ CreateStandardPageSize()

Rect PdfPage::CreateStandardPageSize ( const PdfPageSize  pageSize,
bool  landscape = false 
)
static

Creates a Rect with the page size as values which is needed to create a PdfPage object from an enum which are defined for a few standard page sizes.

Parameters
pageSizethe page size you want
landscapecreate a landscape pagesize instead of portrait (by exchanging width and height)
Returns
a Rect object which can be passed to the PdfPage constructor

◆ GetArtBox()

Rect PdfPage::GetArtBox ( ) const

Get the current ArtBox in PDF units.

Returns
Rect the page box

◆ GetBleedBox()

Rect PdfPage::GetBleedBox ( ) const

Get the current BleedBox (extra area for printing purposes) in PDF units.

Returns
Rect the page box

◆ GetCropBox()

Rect PdfPage::GetCropBox ( ) const

Get the current CropBox (visible page size) in PDF units.

Returns
Rect the page box

◆ GetFieldsIterator()

PdfPageFieldIterable PdfPage::GetFieldsIterator ( )

Get an iterator for all fields in the page.

All widget annotation fields in the pages will be returned

◆ GetMediaBox()

Rect PdfPage::GetMediaBox ( ) const

Get the current MediaBox (physical page size) in PDF units.

Returns
Rect the page box

◆ GetPageNumber()

unsigned PdfPage::GetPageNumber ( ) const

Page number inside of the document.

The first page has the number 1

Returns
the number of the page inside of the document

◆ GetRect()

Rect PoDoFo::PdfPage::GetRect ( ) const
inline

Get the rectangle of this page.

Returns
a rectangle. It's oriented according to the canonical PDF coordinate system

◆ GetRectRaw()

Corners PdfPage::GetRectRaw ( ) const
overridevirtual

Get the current canvas size in PDF Units.

Returns
a Rect containing the page size available for drawing

Implements PoDoFo::PdfCanvas.

◆ GetRotation()

unsigned PoDoFo::PdfPage::GetRotation ( ) const
inline

Get the normalized page rotation (0, 90, 180 or 270)

Returns
a clockwise rotation in degrees

◆ GetRotationRadians()

double PdfPage::GetRotationRadians ( ) const

Get the current page rotation in radians.

Returns
a counterclockwise rotation in radians

◆ GetTrimBox()

Rect PdfPage::GetTrimBox ( ) const

Get the current TrimBox (cut area) in PDF units.

Returns
Rect the page box

◆ SetArtBox()

void PdfPage::SetArtBox ( const Rect rect)

Set the /ArtBox in PDF Units.

Parameters
recta Rect in PDF units

◆ SetBleedBox()

void PdfPage::SetBleedBox ( const Rect rect)

Set the /BleedBox in PDF Units.

Parameters
recta Rect in PDF units

◆ SetCropBox()

void PdfPage::SetCropBox ( const Rect rect)

Set the /CropBox in PDF Units.

Parameters
recta Rect in PDF units

◆ SetMediaBox()

void PdfPage::SetMediaBox ( const Rect rect)

Set the /MediaBox in PDF Units.

Parameters
recta Rect in PDF units

◆ SetRect()

void PdfPage::SetRect ( const Rect rect)

Set the rectangle of this annotation.

Parameters
rectrectangle to set. It's oriented according to the canonical PDF coordinate system

◆ SetRotation()

void PdfPage::SetRotation ( int  rotation)

Set the current page rotation.

Parameters
rotationThe rotation to set to the page. Must be a multiple of 90
Remarks
The actual stored rotation will be normalzed to 0, 90, 180 or 270

◆ SetTrimBox()

void PdfPage::SetTrimBox ( const Rect rect)

Set the /TrimBox in PDF Units.

Parameters
recta Rect in PDF units

◆ TryGetRotationRadians()

bool PdfPage::TryGetRotationRadians ( double teta) const
overridevirtual

Try getting the current canvas rotation.

Parameters
tetacounterclockwise rotation in radians
Returns
true if the canvas has a rotation

Implements PoDoFo::PdfCanvas.

◆ TryGetRotationRaw()

bool PdfPage::TryGetRotationRaw ( double rotation) const

Get the raw page rotation (if any)

Parameters
rotationa clockwise rotation in degrees
Remarks
it may return an invalid page rotation

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