PoDoFo 0.9.20
Public Member Functions | List of all members
PoDoFo::PdfCanvas Class Referenceabstract

#include <PdfCanvas.h>

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

Public Member Functions

virtual ~PdfCanvas ()
 
const PdfObjectGetContentsObject () const
 
virtual PdfObjectStreamGetStreamForAppending (PdfStreamAppendFlags flags)=0
 
PdfObjectGetFromResources (const std::string_view &type, const std::string_view &key)
 
PdfResourcesGetResources ()
 
virtual PdfResourcesGetOrCreateResources ()=0
 
virtual void EnsureResourcesCreated ()=0
 
virtual Rect GetRectRaw () const =0
 
virtual bool HasRotation (double &teta) const =0
 

Detailed Description

A interface that provides the necessary features for a painter to draw onto a PdfObject.

Constructor & Destructor Documentation

◆ ~PdfCanvas()

PdfCanvas::~PdfCanvas ( )
virtual

Virtual destructor to avoid compiler warnings

Member Function Documentation

◆ EnsureResourcesCreated()

virtual void PoDoFo::PdfCanvas::EnsureResourcesCreated ( )
pure virtual

Ensure resources initialized on this canvas

◆ GetContentsObject()

const PdfObject * PdfCanvas::GetContentsObject ( ) const

Get access to the contents object of this page. If you want to draw onto the page, you have to add drawing commands to the stream of the Contents object.

Returns
a contents object

◆ GetFromResources()

PdfObject * PoDoFo::PdfCanvas::GetFromResources ( const std::string_view &  type,
const std::string_view &  key 
)

Get an element from the pages resources dictionary, using a type (category) and a key.

Parameters
typethe type of resource to fetch (e.g. /Font, or /XObject)
keythe key of the resource
Returns
the object of the resource or nullptr if it was not found

◆ GetOrCreateResources()

virtual PdfResources & PoDoFo::PdfCanvas::GetOrCreateResources ( )
pure virtual

Get or create the resource object of this page.

Returns
a resources object

Implemented in PoDoFo::PdfPage.

◆ GetRectRaw()

virtual Rect PoDoFo::PdfCanvas::GetRectRaw ( ) const
pure virtual

Get the current canvas size in PDF Units

Returns
a Rect containing the page size available for drawing

Implemented in PoDoFo::PdfPage.

◆ GetResources()

PdfResources * PdfCanvas::GetResources ( )

Get the resource object of this page.

Returns
a resources object

◆ GetStreamForAppending()

virtual PdfObjectStream & PoDoFo::PdfCanvas::GetStreamForAppending ( PdfStreamAppendFlags  flags)
pure virtual

Get access an object that you can use to ADD drawing to. If you want to draw onto the page, you have to add drawing commands to the stream of the Contents object.

Returns
a contents object

◆ HasRotation()

virtual bool PoDoFo::PdfCanvas::HasRotation ( double &  teta) const
pure virtual

Get the current canvas rotation

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

Implemented in PoDoFo::PdfPage.