#include <PdfAnnotation.h>
Inherits mm::PdfDictionaryElement.
|
| | PdfAnnotation (PdfPage &page, PdfAnnotationType annotType, const PdfRect &rect) |
| |
| | PdfAnnotation (PdfPage &page, PdfObject &obj) |
| |
| void | SetAppearanceStream (PdfXObjectForm &obj, PdfAnnotationAppearance appearance=PdfAnnotationAppearance::Normal, const PdfName &state="") |
| |
| bool | HasAppearanceStream () const |
| |
| PdfObject * | GetAppearanceDictionary () |
| |
| PdfObject * | GetAppearanceStream (PdfAnnotationAppearance appearance=PdfAnnotationAppearance::Normal, const PdfName &state="") |
| |
| PdfRect | GetRect () const |
| |
| void | SetRect (const PdfRect &rect) |
| |
| void | SetFlags (PdfAnnotationFlags uiFlags) |
| |
| PdfAnnotationFlags | GetFlags () const |
| |
| void | SetBorderStyle (double hCorner, double vCorner, double width) |
| |
| void | SetBorderStyle (double hCorner, double vCorner, double width, const PdfArray &strokeStyle) |
| |
| void | SetTitle (const PdfString &title) |
| |
| nullable< PdfString > | GetTitle () const |
| |
| void | SetContents (const PdfString &contents) |
| |
| nullable< PdfString > | GetContents () const |
| |
| void | SetDestination (const std::shared_ptr< PdfDestination > &destination) |
| |
| std::shared_ptr< PdfDestination > | GetDestination () const |
| |
| bool | HasDestination () const |
| |
| void | SetAction (const std::shared_ptr< PdfAction > &action) |
| |
| std::shared_ptr< PdfAction > | GetAction () const |
| |
| bool | HasAction () const |
| |
| void | SetOpen (bool b) |
| |
| bool | GetOpen () const |
| |
| bool | HasFileAttachement () const |
| |
| void | SetFileAttachement (const std::shared_ptr< PdfFileSpec > &fileSpec) |
| |
| std::shared_ptr< PdfFileSpec > | GetFileAttachement () const |
| |
| PdfArray | GetQuadPoints () const |
| |
| void | SetQuadPoints (const PdfArray &quadPoints) |
| |
| PdfArray | GetColor () const |
| |
| void | SetColor (double r, double g, double b) |
| |
| void | SetColor (double c, double m, double y, double k) |
| |
| void | SetColor (double gray) |
| |
| void | SetColor () |
| |
| PdfAnnotationType | GetType () const |
| |
| PdfPage * | GetPage () const |
| |
An annotation to a PdfPage To create an annotation use PdfPage::CreateAnnotation
- See also
- PdfPage::CreateAnnotation
◆ PdfAnnotation() [1/2]
Create a new annotation object
- Parameters
-
| page | the parent page of this annotation |
| eAnnot | type of the annotation |
| rect | the rectangle in which the annotation will appear on the page |
| parent | parent of this annotation |
- See also
- PdfPage::CreateAnnotation
◆ PdfAnnotation() [2/2]
Create a PdfAnnotation from an existing object
- Parameters
-
| obj | the annotations object |
| page | the page of the annotation |
◆ GetAction()
| shared_ptr< PdfAction > PdfAnnotation::GetAction |
( |
| ) |
const |
Get the action that is executed for this annotation
- Returns
- an action object. The action object is owned by the PdfAnnotation.
- See also
- SetAction
◆ GetAppearanceDictionary()
| PdfObject * PdfAnnotation::GetAppearanceDictionary |
( |
| ) |
|
- Returns
- the appearance object /AP for this object
◆ GetAppearanceStream()
- Returns
- the appearance stream for this object
- Parameters
-
| appearance | an apperance type to get |
| state | a child state. Meaning depends on the annotation type |
◆ GetColor()
| PdfArray PdfAnnotation::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. The PdfArray contains 0 to four numbers, depending on the colorspace in which the color is specified 0 numbers means the annotation is transparent 1 number specifies the intensity of the color in grayscale 3 numbers specifie the color in the RGB colorspace and 4 numbers specify the color in the CMYK colorspace
- Returns
- a PdfArray of either 0, 1, 3 or 4 numbers depending on the colorspace in which the color is specified
◆ GetContents()
Get the text of this annotation
- Returns
- the contents of this annotation
- See also
- SetContents
◆ GetDestination()
Get the destination of a link annotations
- Returns
- a destination object
- See also
- SetDestination
◆ GetFileAttachement()
| shared_ptr< PdfFileSpec > PdfAnnotation::GetFileAttachement |
( |
| ) |
const |
Get a file attachement of this annotation.
- Returns
- a file specification object. The file specification object is owned by the PdfAnnotation.
- See also
- SetFileAttachement
◆ GetFlags()
Get the flags of this annotation.
- Returns
- the flags which is an unsigned 32bit integer with different PdfAnnotationFlags OR'ed together.
- See also
- SetFlags
◆ GetOpen()
| bool PdfAnnotation::GetOpen |
( |
| ) |
const |
- Returns
- true if this annotation should be opened immediately by the viewer
◆ GetPage()
| PdfPage * mm::PdfAnnotation::GetPage |
( |
| ) |
const |
|
inline |
Get the page of this PdfField
- Returns
- the page of this PdfField
◆ GetQuadPoints()
| PdfArray PdfAnnotation::GetQuadPoints |
( |
| ) |
const |
Get the quad points associated with the annotation (if appropriate). This array is used in text markup annotations to describe the regions affected by the markup (i.e. the hilighted words, one quadrilateral per word)
- Returns
- a PdfArray of 8xn numbers describing the x,y coordinates of BL BR TR TL corners of the quadrilaterals. If inappropriate, returns an empty array.
◆ GetRect()
| PdfRect PdfAnnotation::GetRect |
( |
| ) |
const |
Get the rectangle of this annotation.
- Returns
- a rectangle
◆ GetTitle()
Get the title of this annotation
- Returns
- the title of this annotation
- See also
- SetTitle
◆ GetType()
Get the type of this annotation
- Returns
- the annotation type
◆ HasAction()
| bool PdfAnnotation::HasAction |
( |
| ) |
const |
- Returns
- true if this annotation has an action
◆ HasAppearanceStream()
| bool PdfAnnotation::HasAppearanceStream |
( |
| ) |
const |
- Returns
- true if this annotation has an appearance stream
◆ HasDestination()
| bool PdfAnnotation::HasDestination |
( |
| ) |
const |
- Returns
- true if this annotation has an destination
◆ HasFileAttachement()
| bool PdfAnnotation::HasFileAttachement |
( |
| ) |
const |
- Returns
- true if this annotation has a file attachement
◆ SetAction()
| void PdfAnnotation::SetAction |
( |
const std::shared_ptr< PdfAction > & |
action | ) |
|
Set the action that is executed for this annotation
- Parameters
-
- See also
- GetAction
◆ SetAppearanceStream()
Set an appearance stream for this object to specify its visual appearance
- Parameters
-
| obj | an XObject |
| appearance | an apperance type to set |
| state | the 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
-
| hCorner | horitzontal corner radius |
| vCorner | vertical corner radius |
| width | width of border |
◆ SetBorderStyle() [2/2]
| void PdfAnnotation::SetBorderStyle |
( |
double |
hCorner, |
|
|
double |
vCorner, |
|
|
double |
width, |
|
|
const PdfArray & |
strokeStyle |
|
) |
| |
Set the annotations border style.
- Parameters
-
| hCorner | horitzontal corner radius |
| dVCorner | vertical corner radius |
| width | width of border |
| strokeStyle | a custom stroke style pattern |
◆ SetColor() [1/4]
| void PdfAnnotation::SetColor |
( |
| ) |
|
Set the C key of the Annotation dictionary to an empty array, which, as per 8.4 of the pdf spec., makes the annotation transparent
◆ SetColor() [2/4]
| void PdfAnnotation::SetColor |
( |
double |
c, |
|
|
double |
m, |
|
|
double |
y, |
|
|
double |
k |
|
) |
| |
Set the C key of the Annotation dictionary, which defines the color of the annotation, as per 8.4 of the pdf spec. Parameters give the color in cmyk colorspace coordinates
- Parameters
-
| c | number from 0 to 1, the intensity of the cyan channel |
| m | number from 0 to 1, the intensity of the magneta channel |
| y | number from 0 to 1, the intensity of the yellow channel |
| k | number from 0 to 1, the intensity of the black channel |
◆ SetColor() [3/4]
| void PdfAnnotation::SetColor |
( |
double |
gray | ) |
|
Set the C key of the Annotation dictionary, which defines the color of the annotation, as per 8.4 of the pdf spec. Parameters give the color in grayscale colorspace coordinates
- Parameters
-
| gray | number from 0 to 1, the intensity of the black |
◆ SetColor() [4/4]
| void PdfAnnotation::SetColor |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b |
|
) |
| |
Set the C key of the Annotation dictionary, which defines the color of the annotation, as per 8.4 of the pdf spec. Parameters give the color in rgb colorspace coordinates
- Parameters
-
| r | number from 0 to 1, the intensity of the red channel |
| g | number from 0 to 1, the intensity of the green channel |
| b | number from 0 to 1, the intensity of the blue channel |
◆ SetContents()
| void PdfAnnotation::SetContents |
( |
const PdfString & |
contents | ) |
|
Set the text of this annotation.
- Parameters
-
| sContents | text of the annoation as string in PDF format |
- See also
- GetContents
◆ SetDestination()
| void PdfAnnotation::SetDestination |
( |
const std::shared_ptr< PdfDestination > & |
destination | ) |
|
Set the destination for link annotations
- Parameters
-
| destination | target of the link |
- See also
- GetDestination
◆ SetFileAttachement()
| void PdfAnnotation::SetFileAttachement |
( |
const std::shared_ptr< PdfFileSpec > & |
fileSpec | ) |
|
Set a file attachment for this annotation. The type of this annotation has to be PdfAnnotationType::FileAttachement for file attachements to work.
- Parameters
-
| rFileSpec | a file specification |
◆ SetFlags()
Set the flags of this annotation.
- Parameters
-
| uiFlags | is an unsigned 32bit integer with different PdfAnnotationFlags OR'ed together. |
- See also
- GetFlags
◆ SetOpen()
| void PdfAnnotation::SetOpen |
( |
bool |
b | ) |
|
Sets whether this annotation is initialy open. You should always set this true for popup annotations.
- Parameters
-
◆ SetQuadPoints()
| void PdfAnnotation::SetQuadPoints |
( |
const PdfArray & |
quadPoints | ) |
|
Set the quad points associated with the annotation (if appropriate). This array is used in text markup annotations to describe the regions affected by the markup (i.e. the hilighted words, one quadrilateral per word)
- Parameters
-
| quadPoints | a PdfArray of 8xn numbers describing the x,y coordinates of BL BR TR TL corners of the quadrilaterals. |
◆ SetRect()
| void PdfAnnotation::SetRect |
( |
const PdfRect & |
rect | ) |
|
Set the rectangle of this annotation.
- Parameters
-
◆ SetTitle()
| void PdfAnnotation::SetTitle |
( |
const PdfString & |
title | ) |
|
Set the title of this annotation.
- Parameters
-
| title | title of the annoation as string in PDF format |
- See also
- GetTitle