PoDoFo 0.9.20
PoDoFo::PdfPage Class Referencefinal

#include <PdfPage.h>

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

Public Member Functions

Rect GetRectRaw () const override
 
bool HasRotation (double &teta) const override
 
bool SetPageWidth (int newWidth)
 
bool SetPageHeight (int newHeight)
 
void SetMediaBox (const Rect &rect, bool raw=false)
 
void SetCropBox (const Rect &rect, bool raw=false)
 
void SetTrimBox (const Rect &rect, bool raw=false)
 
void SetBleedBox (const Rect &rect, bool raw=false)
 
void SetArtBox (const Rect &rect, bool raw=false)
 
unsigned GetPageNumber () const
 
Rect GetMediaBox (bool raw=false) const
 
Rect GetCropBox (bool raw=false) const
 
Rect GetTrimBox (bool raw=false) const
 
Rect GetBleedBox (bool raw=false) const
 
Rect GetArtBox (bool raw=false) const
 
int GetRotationRaw () const
 
void SetRotationRaw (int rotation)
 
void MoveAt (unsigned index)
 
void SetICCProfile (const std::string_view &csTag, InputStream &stream, int64_t colorComponents, PdfColorSpace alternateColorSpace=PdfColorSpace::DeviceRGB)
 
PdfResourcesGetOrCreateResources () override
 
- Public Member Functions inherited from PoDoFo::PdfCanvas
virtual ~PdfCanvas ()
 
const PdfObjectGetContentsObject () const
 
PdfObjectGetFromResources (const std::string_view &type, const std::string_view &key)
 
PdfResourcesGetResources ()
 

Static Public Member Functions

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

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 ( bool raw = false) const

Get the current ArtBox in PDF units.

Returns
Rect the page box

◆ GetBleedBox()

Rect PdfPage::GetBleedBox ( bool raw = false) const

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

Returns
Rect the page box

◆ GetCropBox()

Rect PdfPage::GetCropBox ( bool raw = false) const

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

Returns
Rect the page box

◆ GetMediaBox()

Rect PdfPage::GetMediaBox ( bool raw = false) const

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

Returns
Rect the page box

◆ GetOrCreateResources()

PdfResources & PdfPage::GetOrCreateResources ( )
overridevirtual

Get or create the resource object of this page.

Returns
a resources object

Implements PoDoFo::PdfCanvas.

◆ 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

◆ GetRectRaw()

Rect 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.

◆ GetRotationRaw()

int PdfPage::GetRotationRaw ( ) const

Get the current page rotation (if any), it's a clockwise rotation

Returns
int 0, 90, 180 or 270

◆ GetTrimBox()

Rect PdfPage::GetTrimBox ( bool raw = false) const

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

Returns
Rect the page box

◆ HasRotation()

bool PdfPage::HasRotation ( double & teta) const
overridevirtual

Get the current canvas rotation

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

Implements PoDoFo::PdfCanvas.

◆ MoveAt()

void PdfPage::MoveAt ( unsigned index)

Move the page at the given index

◆ SetArtBox()

void PdfPage::SetArtBox ( const Rect & rect,
bool raw = false )

Set the /ArtBox in PDF Units

Parameters
recta Rect in PDF units

◆ SetBleedBox()

void PdfPage::SetBleedBox ( const Rect & rect,
bool raw = false )

Set the /BleedBox in PDF Units

Parameters
recta Rect in PDF units

◆ SetCropBox()

void PdfPage::SetCropBox ( const Rect & rect,
bool raw = false )

Set the /CropBox in PDF Units

Parameters
recta Rect in PDF units

◆ SetICCProfile()

void PdfPage::SetICCProfile ( const std::string_view & csTag,
InputStream & stream,
int64_t colorComponents,
PdfColorSpace alternateColorSpace = PdfColorSpace::DeviceRGB )

Set an ICC profile for this page

Parameters
csTaga ColorSpace tag
streaman input stream from which the ICC profiles data can be read
colorComponentsthe number of colorcomponents of the ICC profile (expected is 1, 3 or 4 components)
alternateColorSpacean alternate colorspace to use if the ICC profile cannot be used
See also
PdfPainter::SetDependICCProfileColor()

◆ SetMediaBox()

void PdfPage::SetMediaBox ( const Rect & rect,
bool raw = false )

Set the /MediaBox in PDF Units

Parameters
recta Rect in PDF units

◆ SetPageHeight()

bool PdfPage::SetPageHeight ( int newHeight)

Set the current page height in PDF Units

Returns
true if successful, false otherwise

◆ SetPageWidth()

bool PdfPage::SetPageWidth ( int newWidth)

Set the current page width in PDF Units

Returns
true if successful, false otherwise

◆ SetRotationRaw()

void PdfPage::SetRotationRaw ( int rotation)

Set the current page rotation.

Parameters
iRotationRotation to set to the page. Valid value are 0, 90, 180, 270.

◆ SetTrimBox()

void PdfPage::SetTrimBox ( const Rect & rect,
bool raw = false )

Set the /TrimBox in PDF Units

Parameters
recta Rect in PDF units