pdfmm 0.9.20
Public Member Functions | Static Public Member Functions | List of all members
mm::PdfCanvas Class Referenceabstract

#include <PdfCanvas.h>

Inheritance diagram for mm::PdfCanvas:
mm::PdfPage

Public Member Functions

virtual ~PdfCanvas ()
 
virtual PdfObjectGetOrCreateContentsObject ()=0
 
virtual PdfStreamGetStreamForAppending (PdfStreamAppendFlags flags)=0
 
virtual PdfResourcesGetOrCreateResources ()=0
 
virtual PdfRect GetRect () const =0
 
virtual bool HasRotation (double &teta) const =0
 
void AddColorResource (const PdfColor &color)
 
void AddResource (const PdfName &identifier, const PdfReference &ref, const PdfName &name)
 

Static Public Member Functions

static PdfArray GetProcSet ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~PdfCanvas()

virtual mm::PdfCanvas::~PdfCanvas ( )
inlinevirtual

Virtual destructor to avoid compiler warnings

Member Function Documentation

◆ AddColorResource()

void PdfCanvas::AddColorResource ( const PdfColor color)

Register a colourspace for a (separation) colour in the resource dictionary of this page or XObject so that it can be used for any following drawing operations.

Parameters
colorreference to the PdfColor

◆ AddResource()

void PdfCanvas::AddResource ( const PdfName identifier,
const PdfReference ref,
const PdfName name 
)

Register an object in the resource dictionary of this page or XObbject so that it can be used for any following drawing operations.

Parameters
identifieridentifier of this object, e.g. /Ft0
refreference to the object you want to register
nameregister under this key in the resource dictionary

◆ GetOrCreateContentsObject()

virtual PdfObject & mm::PdfCanvas::GetOrCreateContentsObject ( )
pure virtual

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

◆ GetOrCreateResources()

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

Get access to the resources object of this page. This is most likely an internal object.

Returns
a resources object

◆ GetProcSet()

PdfArray PdfCanvas::GetProcSet ( )
static

Get a copy of procset PdfArray.

Returns
a procset PdfArray

◆ GetRect()

virtual PdfRect mm::PdfCanvas::GetRect ( ) const
pure virtual

Get the current canvas size in PDF Units

Returns
a PdfRect containing the page size available for drawing

Implemented in mm::PdfPage.

◆ GetStreamForAppending()

virtual PdfStream & mm::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 mm::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 mm::PdfPage.