PDFix SDK  7.2.0
Loading...
Searching...
No Matches
PdfAnnot Struct Referenceabstract

PdfAnnot class. More...

#include <pdfix.h>

Inheritance diagram for PdfAnnot:
PdfLinkAnnot PdfMarkupAnnot PdfWidgetAnnot PdfTextAnnot PdfTextMarkupAnnot

Public Member Functions

virtual PdfAnnotSubtype GetSubtype () const =0
 Gets an annotation's subtype. More...
 
virtual PdfAnnotFlags GetFlags () const =0
 Gets an annotation's flags. More...
 
virtual bool SetFlags (PdfAnnotFlags flags)=0
 Sets an annotation's flags. More...
 
virtual void GetAppearance (PdfAnnotAppearance *appearance)=0
 Gets an annotation's appearance. More...
 
virtual PdsStreamGetAppearanceXObject (PdfAnnotAppearanceMode mode)=0
 Gets an annotation's appearance stream. More...
 
virtual bool SetAppearanceFromXObject (PdsStream *xobj, PdfAnnotAppearanceMode mode)=0
 Set an annotation's appearance from an XObject. More...
 
virtual bool RefreshAppearance ()=0
 Regenerates the appearance stream for the annotation. More...
 
virtual void GetBBox (PdfRect *bbox) const =0
 Gets the annotation bounding box. More...
 
virtual bool PointInAnnot (const PdfPoint *point) const =0
 
virtual bool RectInAnnot (const PdfRect *rect) const =0
 
virtual PdsObjectGetStructObject (bool struct_parent)=0
 
virtual PdsDictionaryGetObject ()=0
 Gets the annotation object dictionary. More...
 
virtual void NotifyWillChange (const wchar_t *key)=0
 
virtual void NotifyDidChange (const wchar_t *key, int err)=0
 
virtual bool IsValid () const =0
 
virtual bool IsMarkup () const =0
 Tests whether an annotation is markup. More...
 
virtual bool CanCopy ()=0
 
virtual bool CanPaste (PdfPage *dest_page, const PdfPoint *center, void *data)=0
 
virtual void * Copy ()=0
 Copies annotation object data to a clipboard structure, from which it can be pasted. More...
 
virtual PdfAnnotPaste (PdfPage *dest_page, PdfPoint *center, void *data)=0
 
virtual void DestroyClipboardData (void *data)=0
 
virtual int GetStateFlags () const =0
 Get the annotation state flags. More...
 
virtual bool SetStateFlags (PdfStateFlags flags)=0
 Set the annotation state flags. More...
 
virtual PdsDictionaryGetPageObject ()=0
 Get the annotation page object. More...
 

Detailed Description

PdfAnnot class.

An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF document, or provides a way to interact with the user by means of the mouse and keyboard.

Member Function Documentation

◆ CanCopy()

virtual bool PdfAnnot::CanCopy ( )
pure virtual

Tests whether the data from an annotation on a given page can be copied to a clipboard for pasting. This depends on whether there is a PdfAnnotHandler with copy and paste support for the annotation, and whether copying is allowed by document permissions.

Returns
true if if the annotation can be copied, false otherwise.

◆ CanPaste()

virtual bool PdfAnnot::CanPaste ( PdfPage dest_page,
const PdfPoint center,
void *  data 
)
pure virtual

Tests whether data from an annotation that has been copied to a clipboard can be pasted to a location on a page. Pasting can be disallowed by document permissions, or because the annotation cannot be accurately reproduced in the destination document.

Parameters
dest_pageThe page to which the annotation would be pasted.
centerThe location for the center of the annotation on the destination page.
dataThe clipboard data that will be pasted to the page.
Returns
true if the annotation data can be pasted, false otherwise.

◆ Copy()

virtual void * PdfAnnot::Copy ( )
pure virtual

Copies annotation object data to a clipboard structure, from which it can be pasted.

Returns
the annotation clipboard data.

◆ DestroyClipboardData()

virtual void PdfAnnot::DestroyClipboardData ( void *  data)
pure virtual

Destroys data that has been copied from an annotation object into a clipboard. Use this method after successfully pasting the data to a new document.

Parameters
dest_pageThe page to which the annotation is pasted.
centerThe location for the center of the annotation on the destination page.
Returns
A newly created annotation object associated with the specified document, containing the same data as the copied annotation.

◆ GetAppearance()

virtual void PdfAnnot::GetAppearance ( PdfAnnotAppearance appearance)
pure virtual

Gets an annotation's appearance.

Parameters
appearance(filled by method) Pointer to a PdfAnnotAppearance structure.

◆ GetAppearanceXObject()

virtual PdsStream * PdfAnnot::GetAppearanceXObject ( PdfAnnotAppearanceMode  mode)
pure virtual

Gets an annotation's appearance stream.

Parameters
modeThe apearance mode.
Returns
PdsStream object corresponding to the appearance stream.

◆ GetBBox()

virtual void PdfAnnot::GetBBox ( PdfRect bbox) const
pure virtual

Gets the annotation bounding box.

Parameters
bbox(Filled by the method) Pointer to PdfRect structure to fill.

◆ GetFlags()

virtual PdfAnnotFlags PdfAnnot::GetFlags ( ) const
pure virtual

Gets an annotation's flags.

Returns
The flags, or 0 if the annotation does not have a flags key.

◆ GetObject()

virtual PdsDictionary * PdfAnnot::GetObject ( )
pure virtual

Gets the annotation object dictionary.

Returns
an annotation dictionary.

◆ GetPageObject()

virtual PdsDictionary * PdfAnnot::GetPageObject ( )
pure virtual

Get the annotation page object.

Returns
the page dictionary on which the annotation is or null if annotation is not on any page

◆ GetStateFlags()

virtual int PdfAnnot::GetStateFlags ( ) const
pure virtual

Get the annotation state flags.

Returns
the annotation state flags as PdfStateFlags.

◆ GetStructObject()

virtual PdsObject * PdfAnnot::GetStructObject ( bool  struct_parent)
pure virtual

Gets the corresponding struct element object from the document structure tree. Iterates hierarchy of objects from the structure tree. If there is a reference to the current annotation, a structure element object with this reference is returned.

Parameters
struct_parentIf set to true, ParentTree is used in finding the structure element to which the annotation belongs.
Returns
PdsObject object corresponding to the found structure element, otherwise nullptr.
See also
PdsStructTree::GetStructElementFromObject

◆ GetSubtype()

virtual PdfAnnotSubtype PdfAnnot::GetSubtype ( ) const
pure virtual

Gets an annotation's subtype.

Returns
The PdfAnnotSubtype corresponding to the annot's subtype.

◆ IsMarkup()

virtual bool PdfAnnot::IsMarkup ( ) const
pure virtual

Tests whether an annotation is markup.

Returns
true if an PdfAnnot is markup, false otherwise.

◆ IsValid()

virtual bool PdfAnnot::IsValid ( ) const
pure virtual

Tests whether an annotation is valid. This is intended only to ensure that the annotation has not been deleted, not to ensure that all necessary information is present and valid.

Returns
true if an PdfAnnot is a valid annotation object, false otherwise.

◆ NotifyDidChange()

virtual void PdfAnnot::NotifyDidChange ( const wchar_t *  key,
int  err 
)
pure virtual

Broadcasts a PDAnnotDidChange() notification. Clients must call this method after making any change to a custom annotation.

Parameters
keyThe name of the key in the annotation's dictionary that is changing.
errAn error code to pass to any method registered to receive the PDAnnotDidChange() notification. Pass zero if the annotation was changed successfully. Pass a nonzero value if an error occurred while changing the annotation.

◆ NotifyWillChange()

virtual void PdfAnnot::NotifyWillChange ( const wchar_t *  key)
pure virtual

Broadcasts a PDAnnotWillChange() notification. Clients must call this method before making any change to a custom annotation.

Parameters
keyThe name of the key in the annotation's dictionary that is changing.

◆ Paste()

virtual PdfAnnot * PdfAnnot::Paste ( PdfPage dest_page,
PdfPoint center,
void *  data 
)
pure virtual

Pastes copied annotation data from a clipboard structure to a new annotation object in a specified document. After successfully pasting the data, use PdfAnnot::DestroyClipboardData() to free the associated memory.

Parameters
dest_pageThe page to which the annotation is pasted.
centerThe location for the center of the annotation on the destination page. If center is null, the annotation will be moved to the center of the destination page's crop box.
Returns
A newly created annotation object associated with the specified document, containing the same data as the copied annotation.

◆ PointInAnnot()

virtual bool PdfAnnot::PointInAnnot ( const PdfPoint point) const
pure virtual

Tests whether the specified point is within an annotation. If an annotation consists of more quads, it tests each quad individually.

Parameters
pointThe point to test.
Returns
true if the point is within an annotation, false otherwise.

◆ RectInAnnot()

virtual bool PdfAnnot::RectInAnnot ( const PdfRect rect) const
pure virtual

Tests whether the specified rect is within an annotation. If an annotation consists of more quads, it tests each quad individually.

Parameters
rectThe rectangle to test.
Returns
true if the the whole rectangle is within an annotation, false otherwise.

◆ RefreshAppearance()

virtual bool PdfAnnot::RefreshAppearance ( )
pure virtual

Regenerates the appearance stream for the annotation.

Returns
true if the appearance was successfully regenerated, false otherwise

◆ SetAppearanceFromXObject()

virtual bool PdfAnnot::SetAppearanceFromXObject ( PdsStream xobj,
PdfAnnotAppearanceMode  mode 
)
pure virtual

Set an annotation's appearance from an XObject.

Parameters
xobjPointer to a XObject.
Returns
true if the appearance was successfully set, false otherwise
See also
PdfDoc::CreateXObjectFromImage, PdsContent::ToObject

◆ SetFlags()

virtual bool PdfAnnot::SetFlags ( PdfAnnotFlags  flags)
pure virtual

Sets an annotation's flags.

Parameters
Thecombination of PdfAnnotFlags flag keys.

◆ SetStateFlags()

virtual bool PdfAnnot::SetStateFlags ( PdfStateFlags  flags)
pure virtual

Set the annotation state flags.

Parameters
flagsthe PdfStateFlags flags to be set
Returns
true if the annotation's state flags was set false otherwise