PoDoFo  1.0.0-dev
Public Member Functions | Static Public Member Functions | Friends | List of all members
PoDoFo::PdfAnnotation Class Reference

An annotation to a PdfPage To create an annotation use PdfPage::CreateAnnotation. More...

#include <PdfAnnotation.h>

Inherits PoDoFo::PdfDictionaryElement.

Inherited by PoDoFo::PdfAnnotationActionBase, PoDoFo::PdfAnnotationCaret, PoDoFo::PdfAnnotationCircle, PoDoFo::PdfAnnotationFileAttachment, PoDoFo::PdfAnnotationFreeText, PoDoFo::PdfAnnotationInk, PoDoFo::PdfAnnotationLine, PoDoFo::PdfAnnotationModel3D, PoDoFo::PdfAnnotationMovie, PoDoFo::PdfAnnotationPolyLine, PoDoFo::PdfAnnotationPolygon, PoDoFo::PdfAnnotationPopup, PoDoFo::PdfAnnotationPrinterMark, PoDoFo::PdfAnnotationProjection, PoDoFo::PdfAnnotationRedact, PoDoFo::PdfAnnotationRichMedia, PoDoFo::PdfAnnotationSound, PoDoFo::PdfAnnotationSquare, PoDoFo::PdfAnnotationStamp, PoDoFo::PdfAnnotationText, PoDoFo::PdfAnnotationTextMarkupBase, PoDoFo::PdfAnnotationTrapNet, PoDoFo::PdfAnnotationWatermark, and PoDoFo::PdfAnnotationWebMedia.

Public Member Functions

void SetAppearanceStream (const PdfXObjectForm &xobj, PdfAppearanceType appearance=PdfAppearanceType::Normal, const PdfName &state="")
 Set an appearance stream for this object to specify its visual appearance. More...
 
void SetAppearanceStreamRaw (const PdfXObjectForm &xobj, PdfAppearanceType appearance=PdfAppearanceType::Normal, const PdfName &state="")
 Set an appearance stream for this object to specify its visual appearance without handling page rotations. More...
 
void GetAppearanceStreams (std::vector< PdfAppearanceStream > &states) const
 Get a list of qualified appearance streams.
 
void ClearAppearances ()
 
PdfObjectGetAppearanceDictionaryObject ()
 
const PdfObjectGetAppearanceDictionaryObject () const
 
PdfObjectGetAppearanceStream (PdfAppearanceType appearance=PdfAppearanceType::Normal, const std::string_view &state={ })
 
const PdfObjectGetAppearanceStream (PdfAppearanceType appearance=PdfAppearanceType::Normal, const std::string_view &state={ }) const
 
Rect GetRect () const
 Get the rectangle of this annotation. More...
 
Rect GetRectRaw () const
 
void SetRect (const Rect &rect)
 Set the rectangle of this annotation. More...
 
void SetRectRaw (const Rect &rect)
 
void SetFlags (PdfAnnotationFlags flags)
 Set the flags of this annotation. More...
 
PdfAnnotationFlags GetFlags () const
 Get the flags of this annotation. More...
 
void SetBorderStyle (double hCorner, double vCorner, double width)
 Set the annotations border style. More...
 
void SetBorderStyle (double hCorner, double vCorner, double width, const PdfArray &strokeStyle)
 Set the annotations border style. More...
 
void SetTitle (nullable< const PdfString & > title)
 Set the title of this annotation. More...
 
nullable< const PdfString & > GetTitle () const
 Get the title of this annotation. More...
 
void SetContents (nullable< const PdfString & > contents)
 Set the text of this annotation. More...
 
nullable< const PdfString & > GetContents () const
 Get the text of this annotation. More...
 
PdfColor GetColor () const
 Get the color key of the Annotation dictionary which defines the color of the annotation, as per 8.4 of the pdf spec.
 
void SetColor (nullable< const PdfColor & > color)
 Set the C key of the Annotation dictionary, which defines the color of the annotation, as per 8.4 of the pdf spec.
 
PdfAnnotationType GetType () const
 Get the type of this annotation. More...
 
PdfPageGetPage ()
 Get the page of this PdfField. More...
 
const PdfPageGetPage () const
 
PdfPageMustGetPage ()
 
const PdfPageMustGetPage () const
 

Static Public Member Functions

static bool TryCreateFromObject (PdfObject &obj, std::unique_ptr< PdfAnnotation > &xobj)
 
static bool TryCreateFromObject (const PdfObject &obj, std::unique_ptr< const PdfAnnotation > &xobj)
 
template<typename TAnnotation >
static bool TryCreateFromObject (PdfObject &obj, std::unique_ptr< TAnnotation > &xobj)
 
template<typename TAnnotation >
static bool TryCreateFromObject (const PdfObject &obj, std::unique_ptr< const TAnnotation > &xobj)
 

Friends

class PdfAnnotationCollection
 
class PdfAnnotationTextMarkupBase
 
class PdfAnnotationPopup
 
class PdfAnnotationText
 
class PdfAnnotationCaret
 
class PdfAnnotationFileAttachment
 
class PdfAnnotationFreeText
 
class PdfAnnotationHighlight
 
class PdfAnnotationInk
 
class PdfAnnotationLine
 
class PdfAnnotationModel3D
 
class PdfAnnotationMovie
 
class PdfAnnotationPolygon
 
class PdfAnnotationPolyLine
 
class PdfAnnotationPrinterMark
 
class PdfAnnotationRichMedia
 
class PdfAnnotationScreen
 
class PdfAnnotationSquiggly
 
class PdfAnnotationStrikeOut
 
class PdfAnnotationSound
 
class PdfAnnotationSquare
 
class PdfAnnotationCircle
 
class PdfAnnotationStamp
 
class PdfAnnotationTrapNet
 
class PdfAnnotationUnderline
 
class PdfAnnotationWatermark
 
class PdfAnnotationWebMedia
 
class PdfAnnotationRedact
 
class PdfAnnotationProjection
 
class PdfAnnotationActionBase
 

Detailed Description

An annotation to a PdfPage To create an annotation use PdfPage::CreateAnnotation.

See also
PdfPage::CreateAnnotation

Member Function Documentation

◆ GetAppearanceDictionaryObject()

PdfObject * PdfAnnotation::GetAppearanceDictionaryObject ( )
Returns
the appearance /AP object for this annotation

◆ GetAppearanceStream()

PdfObject* PoDoFo::PdfAnnotation::GetAppearanceStream ( PdfAppearanceType  appearance = PdfAppearanceType::Normal,
const std::string_view &  state = { } 
)
Returns
the appearance stream for this object
Parameters
appearancean appearance type to get
statea child state. Meaning depends on the annotation type

◆ GetContents()

nullable< const PdfString & > PdfAnnotation::GetContents ( ) const

Get the text of this annotation.

Returns
the contents of this annotation
See also
SetContents

◆ GetFlags()

PdfAnnotationFlags PdfAnnotation::GetFlags ( ) const

Get the flags of this annotation.

Returns
the flags which is an unsigned 32bit integer with different PdfAnnotationFlags OR'ed together.
See also
SetFlags

◆ GetPage()

PdfPage* PoDoFo::PdfAnnotation::GetPage ( )
inline

Get the page of this PdfField.

Returns
the page of this PdfField

◆ GetRect()

Rect PdfAnnotation::GetRect ( ) const

Get the rectangle of this annotation.

Returns
a rectangle

◆ GetTitle()

nullable< const PdfString & > PdfAnnotation::GetTitle ( ) const

Get the title of this annotation.

Returns
the title of this annotation
See also
SetTitle

◆ GetType()

PdfAnnotationType PoDoFo::PdfAnnotation::GetType ( ) const
inline

Get the type of this annotation.

Returns
the annotation type

◆ SetAppearanceStream()

void PdfAnnotation::SetAppearanceStream ( const PdfXObjectForm &  xobj,
PdfAppearanceType  appearance = PdfAppearanceType::Normal,
const PdfName state = "" 
)

Set an appearance stream for this object to specify its visual appearance.

Parameters
xobjan XObject form
appearancean appearance type to set
statethe state for which set it the obj; states depend on the annotation type

◆ SetAppearanceStreamRaw()

void PdfAnnotation::SetAppearanceStreamRaw ( const PdfXObjectForm &  xobj,
PdfAppearanceType  appearance = PdfAppearanceType::Normal,
const PdfName state = "" 
)

Set an appearance stream for this object to specify its visual appearance without handling page rotations.

Parameters
xobjan XObject form
appearancean appearance type to set
statethe state for which set it the obj; states depend on the annotation type

◆ SetBorderStyle() [1/2]

void PdfAnnotation::SetBorderStyle ( double  hCorner,
double  vCorner,
double  width 
)

Set the annotations border style.

Parameters
hCornerhoritzontal corner radius
vCornervertical corner radius
widthwidth of border

◆ SetBorderStyle() [2/2]

void PdfAnnotation::SetBorderStyle ( double  hCorner,
double  vCorner,
double  width,
const PdfArray strokeStyle 
)

Set the annotations border style.

Parameters
hCornerhoritzontal corner radius
dVCornervertical corner radius
widthwidth of border
strokeStylea custom stroke style pattern

◆ SetContents()

void PdfAnnotation::SetContents ( nullable< const PdfString & >  contents)

Set the text of this annotation.

Parameters
contentstext of the annotation as string in PDF format
See also
GetContents

◆ SetFlags()

void PdfAnnotation::SetFlags ( PdfAnnotationFlags  flags)

Set the flags of this annotation.

See also
GetFlags

◆ SetRect()

void PdfAnnotation::SetRect ( const Rect rect)

Set the rectangle of this annotation.

Parameters
rectrectangle to set

◆ SetTitle()

void PdfAnnotation::SetTitle ( nullable< const PdfString & >  title)

Set the title of this annotation.

Parameters
titletitle of the annotation as string in PDF format
See also
GetTitle

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