PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
annot.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_PDF_ANNOT_H_INCLUDED_
4#define PDFSDK_CXX_PDF_ANNOT_H_INCLUDED_
5
7#include <pdfsdk/cxx/math.h>
8
9#include "forward_declarations.h"
10#include "wrapper_base.h"
11
12namespace PDF {
13
19class Annot : public detail::RefCountedHandle<PDAnnot> {
20public:
26
32 bool Equals(const Annot& that) const;
33
44 PDAtom GetSubtype() const;
45
56 void SetFlags(PDAnnotFlags flags);
57
68 PDAnnotFlags GetFlags() const;
69
81 void SetRect(const PDF::RectF& rect);
82
95
100 void SetColor(PDColorValue color);
101
106 PDColorValue GetColor() const;
107
117 void SetContents(const std::wstring& contents);
118
128 std::wstring GetContents() const;
129
138 void SetModDate(const PDDateTime& date);
139
149
159 void SetBorder(const PDAnnotBorder& border);
160
171
182
192
199 bool IsVisibleInConfig(OCConfig config) const;
200
215 void SetAppearanceState(PDAtom appState);
216
231 PDAtom GetAppearanceState() const;
232
241 void SetFillOpacity(float opacity);
242
251 float GetFillOpacity() const;
252
261 void SetStrokeOpacity(float opacity);
262
271 float GetStrokeOpacity() const;
272
286 bool HasAppearance(PDAnnotState state, PDAtom appState) const;
287
292 std::wstring GetName() const;
293
298 void SetName(const std::wstring& name);
299
304 bool IsVisible() const;
305
310 void SetVisible(bool visible);
311
320 PDEBlendMode GetBlendMode() const;
321
330 void SetBlendMode(PDEBlendMode blendMode);
331
348 void SetAppearance(PDAnnotState state, PDAtom appState, XObject app);
349
366 XObject GetAppearance(PDAnnotState state, PDAtom appState) const;
367
376 void SetLinkActions(const Action& actions);
377
387
396
405 void SetLinkQuadPoints(const QuadPoints& quadpoints);
406
416
426 void SetLinkBorderStyle(const PDAnnotBorderStyle& borderStyle);
427
437
447 void SetLinkDest(const Dest& dest);
448
457
464 bool IsMarkupAnnot() const;
465
474 void SetMarkupTitle(const std::wstring& title);
475
483 std::wstring GetMarkupTitle() const;
484
495
504 void SetMarkupRichContents(const std::wstring& contents);
505
513 std::wstring GetMarkupRichContents() const;
514
523
532
540 void SetMarkupSubject(const std::wstring& subject);
541
549 std::wstring GetMarkupSubject() const;
550
559 void SetMarkupInReplyTo(const Annot& inReplyTo);
560
566
576
586
595 void SetMarkupIntent(PDAtom intent);
596
605 PDAtom GetMarkupIntent() const;
606
615 void SetTextOpen(bool open);
616
625 bool IsTextOpen() const;
626
637
648
658 std::vector<std::vector<PointF>> GetInkPointsList() const;
659
669 void SetInkPointsList(const std::vector<std::vector<PointF>>& pointslist);
670
681 PDRotate GetWidgetRotate() const;
682
693 void SetWidgetRotate(PDRotate rotate);
694
705
716
723 PDColorValue GetWidgetBorderColor() const;
724
731 void SetWidgetBorderColor(PDColorValue color);
732
739 PDColorValue GetWidgetBackgroundColor() const;
740
747 void SetWidgetBackgroundColor(PDColorValue color);
748
756
763 void SetWidgetFontInfo(const PDFontInfo& fontInfo);
764
771 float GetWidgetFontSize() const;
772
779 void SetWidgetFontSize(float fontSize);
780
785 PDColorValue GetWidgetFontColor() const;
786
791 void SetWidgetFontColor(PDColorValue color);
792
801
809 PDRotate GetFreeTextRotate() const;
810
818 void SetFreeTextRotate(PDRotate rotate);
819
828
837
847
857
867
877
885
892 void SetFreeTextFontInfo(const PDFontInfo& fontInfo);
893
902 PDColorValue GetFreeTextFontColor() const;
903
912 void SetFreeTextFontColor(PDColorValue fontColor);
913
921 PDColorValue GetFreeTextBorderColor() const;
922
930 void SetFreeTextBorderColor(PDColorValue borderColor);
931
940 float GetFreeTextFontSize() const;
941
950 void SetFreeTextFontSize(float fontSize);
951
960 PDAtom GetFreeTextLineEnding() const;
961
970 void SetFreeTextLineEnding(PDAtom endPointStyle);
971
982
992 void SetFreeTextRectDifferences(const RectF& differences);
993
999 size_t HitTestFreeTextChar(const PointF& pagePt) const;
1000
1009 Quad GetFreeTextCharQuad(size_t index) const;
1010
1015 size_t GetFreeTextNumLines() const;
1016
1022
1027 void SetFreeTextLineSpacing(float lineSpacing);
1028
1036
1043 void SetFreeTextCharSpacing(float charSpacing);
1044
1050 size_t GetFreeTextFirstCharOnLine(size_t lineIndex) const;
1051
1057 size_t GetFreeTextLineWithChar(size_t charIndex) const;
1058
1059 PDF_CXX_CORE_WRAPPER_DEFINE_MEMBERS_(Annot, PDAnnot)
1060};
1061
1062} // namespace PDF
1063
1064#include "annot_impl.inl"
1065
1066#endif // PDFSDK_CXX_PDF_ANNOT_H_INCLUDED_
Annotations API.
PDAnnotState
Defines visual appearance of an annotation at different times based on user interaction.
Definition annots.h:68
PDMarkupAnnotReplyType
Defines the relationship between markup annotations.
Definition annots.h:157
PDQuadding
Defines the alignment of text for a free text annotation.
Definition annots.h:138
Represents an action in a PDF document.
Definition action.h:21
Represents an annotation in a PDF document.
Definition annot.h:19
PDQuadding GetFreeTextQuadding() const
Get the text alignment of the free text annotation.
void SetWidgetBackgroundColor(PDColorValue color)
Set the background color of the widget annotation.
PDAnnotBorder GetBorder() const
Get the border of this annotation.
void SetFreeTextRectDifferences(const RectF &differences)
Set the differences in rectangle coordinates between the annotation rectangle and text rectangle with...
void SetFreeTextQuadding(PDQuadding quadding)
Set the text alignment of the free text annotation.
void SetTextMarkupQuadPoints(const QuadPoints &quads)
Set the quad points of the text markup annotation.
void SetFreeTextRotate(PDRotate rotate)
Set the rotation angle of the free text annotation.
bool IsVisible() const
Check if this annotation is visible.
QuadPoints GetLinkQuadPoints() const
Get the link quad points of this annotation.
void SetWidgetFontColor(PDColorValue color)
Set the font color of the widget annotation.
PDAtom GetAppearanceState() const
Get the appearance state of this annotation.
void SetLinkDest(const Dest &dest)
Set the link destination of this annotation.
PDRotate GetFreeTextRotate() const
Get the rotation angle of the free text annotation.
void SetModDate(const PDDateTime &date)
Set the modification date of this annotation.
void SetMarkupSubject(const std::wstring &subject)
Set the subject of the markup annotation.
PDAtom GetSubtype() const
Get the subtype of this annotation.
void SetMarkupCreationDate(const PDDateTime &date)
Set the creation date of the markup annotation.
void SetLinkBorderStyle(const PDAnnotBorderStyle &borderStyle)
Set the border style for a link annotation.
std::wstring GetContents() const
Get the contents of this annotation.
void SetContents(const std::wstring &contents)
Set the contents of this annotation.
PDAtom GetFreeTextLineEnding() const
Get the callout line ending style of the free text annotation.
PDColorValue GetFreeTextBorderColor() const
Get the border color of the free text annotation.
PDColorValue GetColor() const
Get the color of this annotation.
std::wstring GetMarkupSubject() const
Get the subject of the markup annotation.
void SetFreeTextBorderStyle(const PDAnnotBorderStyle &borderStyle)
Set the border style of the free text annotation.
void SetFreeTextFontColor(PDColorValue fontColor)
Set the font color of the free text annotation.
Annot GetMarkupPopup() const
Get the popup annotation associated with the markup annotation.
Action GetLinkActions() const
Get the link actions associated with this annotation.
RectF GetFreeTextRectDifferences() const
Get the differences in rectangle coordinates between the annotation rectangle and text rectangle with...
PDColorValue GetWidgetBackgroundColor() const
Get the background color of the widget annotation.
void RemoveLinkActions()
Remove all link actions associated with this annotation.
void SetMarkupIntent(PDAtom intent)
Set the intent of the markup annotation.
PDDateTime GetModDate() const
Get the latest modification date of this annotation.
QuadPoints GetTextMarkupQuadPoints() const
Get the quad points of the text markup annotation.
void SetFreeTextFontInfo(const PDFontInfo &fontInfo)
Set the font information of the free text annotation.
std::wstring GetName() const
Get the name for an annotation.
void SetInkPointsList(const std::vector< std::vector< PointF > > &pointslist)
Set the list of ink points of the ink annotation.
void SetFreeTextBorderEffect(const PDAnnotBorderEffect &borderEffect)
Set the border effect of the free text annotation.
float GetStrokeOpacity() const
Get the stroke opacity of this annotation.
size_t GetFreeTextNumLines() const
Get the number of lines contained in the free text annotation.
void SetFreeTextLineSpacing(float lineSpacing)
Set the line spacing of the free text annotation.
XObject GetAppearance(PDAnnotState state, PDAtom appState) const
Get the appearance graphics object (XObject) of this annotation for the given state and appearance st...
void SetWidgetFontSize(float fontSize)
Set the font size of the widget annotation.
size_t GetFreeTextFirstCharOnLine(size_t lineIndex) const
Get the index of the first character on the specified line in the free text annotation.
void SetBorder(const PDAnnotBorder &border)
Sets the border for an annotation.
void SetWidgetFontInfo(const PDFontInfo &fontInfo)
Set the font information of the widget annotation.
void SetWidgetBorderStyle(PDAnnotBorderStyle borderStyle)
Set the border style of the widget annotation.
float GetFreeTextCharSpacing() const
Get the character spacing for the free text annotation.
PDColorValue GetWidgetFontColor() const
Get the font color of the widget annotation.
void SetAppearance(PDAnnotState state, PDAtom appState, XObject app)
Set the appearance for an annotation for the given state and appearance state.
void SetVisible(bool visible)
Set the visibility of this annotation.
size_t GetFreeTextLineWithChar(size_t charIndex) const
Get the index of the line containing the specified character for a free text annotation.
PDMarkupAnnotReplyType GetMarkupReplyType() const
Get the reply type of the markup annotation.
PDF::RectF GetRect() const
Get the rectangle of this annotation.
void SetFreeTextCharSpacing(float charSpacing)
Set the character spacing of the free text annotation.
PDAnnotBorderStyle GetLinkBorderStyle() const
Get the link border style of this annotation.
void SetLinkActions(const Action &actions)
Set the link actions of this annotation.
Annot GetMarkupInReplyTo() const
Get the annotation that this markup annotation is in reply to.
PDAnnotBorderStyle GetWidgetBorderStyle() const
Get the border style of the widget annotation.
void SetFlags(PDAnnotFlags flags)
Set the flags of this annotation.
PDAnnotFlags GetFlags() const
Get the flags of this annotation.
void SetTextOpen(bool open)
Set the open state of the text or popup annotation (having a parent markup annotation).
float GetFillOpacity() const
Get the fill opacity of an annotation.
PDFontInfo GetWidgetFontInfo() const
Get the font information of the widget annotation.
PDColorValue GetWidgetBorderColor() const
Get the border color of the widget annotation.
FormField GetWidgetParent() const
Get the parent form field of the widget annotation.
PDRotate GetWidgetRotate() const
Get the rotation angle of the widget annotation.
bool Equals(const Annot &that) const
Check if this annotation is equal to another annotation.
PDDateTime GetMarkupCreationDate() const
Get the creation date of the markup annotation.
void SetStrokeOpacity(float opacity)
Set the stroke opacity of this annotation.
bool IsTextOpen() const
Check if the text or popup annotation is set to be shown.
float GetFreeTextLineSpacing() const
Get the line spacing of the free text annotation.
std::vector< std::vector< PointF > > GetInkPointsList() const
Get the list of ink points of the ink annotation.
void SetName(const std::wstring &name)
Set the name for an annotation.
Dest GetLinkDest() const
Get the link destination of this annotation.
void SetAppearanceState(PDAtom appState)
Set the appearance state for an annotation.
PDColorValue GetFreeTextFontColor() const
Get the font color of the free text annotation.
OCMembership GetOCMD() const
Get the optional content (OC) membership dictionary of this annotation.
void SetFillOpacity(float opacity)
Set the fill opacity of an annotation.
void SetRect(const PDF::RectF &rect)
Set the rectangle of this annotation.
void SetWidgetRotate(PDRotate rotate)
Set the rotation angle of the widget annotation.
void SetLinkQuadPoints(const QuadPoints &quadpoints)
Set the link quad points of this annotation.
std::wstring GetMarkupRichContents() const
Get the rich contents of a markup annotation.
void SetMarkupReplyType(PDMarkupAnnotReplyType replyType)
Set the reply type for a markup annotation.
size_t HitTestFreeTextChar(const PointF &pagePt) const
Perform a hit test to determine which character in the free text annotation is at the specified point...
PDAtom GetMarkupIntent() const
Get the intent of the markup annotation.
Object GetPdfObject() const
Get the PDF object associated with this annotation.
void SetFreeTextFontSize(float fontSize)
Set the font size of the free text annotation.
void SetMarkupTitle(const std::wstring &title)
Set the title of the markup annotation.
float GetWidgetFontSize() const
Get the font size of the widget annotation.
bool HasAppearance(PDAnnotState state, PDAtom appState) const
Check if an annotation has an appearance state defined for one of the three states (Normal,...
void SetColor(PDColorValue color)
Set the color of this annotation.
void SetOCMD(OCMembership ocmd)
Set the optional content (OC) membership dictionary for this annotation.
PDEBlendMode GetBlendMode() const
Get the blend mode of this annotation.
Quad GetFreeTextCharQuad(size_t index) const
Get the quad representing the bounding box of the character at the specified index in the free text a...
void SetMarkupInReplyTo(const Annot &inReplyTo)
Set the in reply to (IRT) for a markup annotation.
void SetWidgetBorderColor(PDColorValue color)
Set the border color of the widget annotation.
float GetFreeTextFontSize() const
Get the font size of the free text annotation.
void SetBlendMode(PDEBlendMode blendMode)
Set the blend mode of this annotation.
void SetFreeTextBorderColor(PDColorValue borderColor)
Set the border color of the free text annotation.
PDAnnotBorderEffect GetFreeTextBorderEffect() const
Get the border effect of the free text annotation.
std::wstring GetMarkupTitle() const
Get the title of the markup annotation.
void SetMarkupRichContents(const std::wstring &contents)
Set the rich contents of a markup annotation.
bool IsVisibleInConfig(OCConfig config) const
Check if an annotation is visible in a given optional content (OC) configuration.
void SetFreeTextLineEnding(PDAtom endPointStyle)
Set the line ending style of the free text annotation.
bool IsMarkupAnnot() const
Check if this annotation is a markup annotation.
PDAnnotBorderStyle GetFreeTextBorderStyle() const
Get the border style of the free text annotation.
PDFontInfo GetFreeTextFontInfo() const
Get the font information of the free text annotation.
Represents a destination in a PDF document.
Definition dest.h:23
Represents a form field in a PDF document.
Definition form_field.h:31
Optional content configuration.
Definition optional_content.h:72
Optional content membership.
Definition optional_content.h:55
Represents a PDF object.
Definition object.h:20
Represents an XObject in a PDF document.
Definition xobject.h:22
Definition annots.h:124
Definition annots.h:78
Definition annots.h:104
Definition types.h:23
Definition math.h:132
Definition math.h:838
Definition math.h:997
Definition math.h:545
Definition fonts.h:25