PDF SDK Documentation

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

Loading...
Searching...
No Matches
annot.h
Go to the documentation of this file.
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
11#include <pdfsdk/core/annots.h>
12#include <pdfsdk/cxx/math.h>
13
14#include "forward_declarations.h"
15#include "wrapper_base.h"
16
17namespace PDF {
18
24class Annot : public detail::RefCountedHandle<PDAnnot> {
25public:
31
37 bool Equals(const Annot& that) const;
38
49 PDAtom GetSubtype() const;
50
61 void SetFlags(PDAnnotFlags flags);
62
73 PDAnnotFlags GetFlags() const;
74
86 void SetRect(const PDF::RectF& rect);
87
100
105 void SetColor(PDColorValue color);
106
111 PDColorValue GetColor() const;
112
122 void SetContents(const std::wstring& contents);
123
133 std::wstring GetContents() const;
134
143 void SetModDate(const PDDateTime& date);
144
154
164 void SetBorder(const PDAnnotBorder& border);
165
176
187
197
204 bool IsVisibleInConfig(OCConfig config) const;
205
220 void SetAppearanceState(PDAtom appState);
221
236 PDAtom GetAppearanceState() const;
237
246 void SetFillOpacity(float opacity);
247
256 float GetFillOpacity() const;
257
266 void SetStrokeOpacity(float opacity);
267
276 float GetStrokeOpacity() const;
277
291 bool HasAppearance(PDAnnotState state, PDAtom appState) const;
292
297 std::wstring GetName() const;
298
303 void SetName(const std::wstring& name);
304
309 bool IsVisible() const;
310
315 void SetVisible(bool visible);
316
326
335 void SetBlendMode(PDEBlendMode blendMode);
336
353 void SetAppearance(PDAnnotState state, PDAtom appState, XObject app);
354
371 XObject GetAppearance(PDAnnotState state, PDAtom appState) const;
372
381 void SetLinkActions(const Action& actions);
382
392
401
410 void SetLinkQuadPoints(const QuadPoints& quadpoints);
411
421
431 void SetLinkBorderStyle(const PDAnnotBorderStyle& borderStyle);
432
442
452 void SetLinkDest(const Dest& dest);
453
462
469 bool IsMarkupAnnot() const;
470
479 void SetMarkupTitle(const std::wstring& title);
480
488 std::wstring GetMarkupTitle() const;
489
500
509 void SetMarkupRichContents(const std::wstring& contents);
510
518 std::wstring GetMarkupRichContents() const;
519
528
537
545 void SetMarkupSubject(const std::wstring& subject);
546
554 std::wstring GetMarkupSubject() const;
555
564 void SetMarkupInReplyTo(const Annot& inReplyTo);
565
571
581
591
600 void SetMarkupIntent(PDAtom intent);
601
610 PDAtom GetMarkupIntent() const;
611
620 void SetTextOpen(bool open);
621
630 bool IsTextOpen() const;
631
642
653
663 std::vector<std::vector<PointF>> GetInkPointsList() const;
664
674 void SetInkPointsList(const std::vector<std::vector<PointF>>& pointslist);
675
687
699
710
721
728 PDColorValue GetWidgetBorderColor() const;
729
736 void SetWidgetBorderColor(PDColorValue color);
737
744 PDColorValue GetWidgetBackgroundColor() const;
745
752 void SetWidgetBackgroundColor(PDColorValue color);
753
761
768 void SetWidgetFontInfo(const PDFontInfo& fontInfo);
769
776 float GetWidgetFontSize() const;
777
784 void SetWidgetFontSize(float fontSize);
785
790 PDColorValue GetWidgetFontColor() const;
791
796 void SetWidgetFontColor(PDColorValue color);
797
806
815
824
833
842
852
862
872
882
890
897 void SetFreeTextFontInfo(const PDFontInfo& fontInfo);
898
907 PDColorValue GetFreeTextFontColor() const;
908
917 void SetFreeTextFontColor(PDColorValue fontColor);
918
926 PDColorValue GetFreeTextBorderColor() const;
927
935 void SetFreeTextBorderColor(PDColorValue borderColor);
936
945 float GetFreeTextFontSize() const;
946
955 void SetFreeTextFontSize(float fontSize);
956
965 PDAtom GetFreeTextLineEnding() const;
966
975 void SetFreeTextLineEnding(PDAtom endPointStyle);
976
987
997 void SetFreeTextRectDifferences(const RectF& differences);
998
1004 size_t HitTestFreeTextChar(const PointF& pagePt) const;
1005
1014 Quad GetFreeTextCharQuad(size_t index) const;
1015
1020 size_t GetFreeTextNumLines() const;
1021
1027
1032 void SetFreeTextLineSpacing(float lineSpacing);
1033
1041
1048 void SetFreeTextCharSpacing(float charSpacing);
1049
1055 size_t GetFreeTextFirstCharOnLine(size_t lineIndex) const;
1056
1062 size_t GetFreeTextLineWithChar(size_t charIndex) const;
1063
1064 PDF_CXX_CORE_WRAPPER_DEFINE_MEMBERS_(Annot, PDAnnot)
1065};
1066
1067} // namespace PDF
1068
1069#include "annot_impl.inl"
1070
1071#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:32
Represents an annotation in a PDF document.
Definition annot.h:24
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:31
Represents a form field in a PDF document.
Definition form_field.h:71
Optional content configuration.
Definition optional_content.h:98
Optional content membership.
Definition optional_content.h:68
Represents a PDF object.
Definition object.h:20
Represents an XObject in a PDF document.
Definition xobject.h:22
PDEBlendMode
Specifies the type of function/mode used to determine how new content interacts with existing content...
Definition content.h:93
Definition annots.h:124
Definition annots.h:78
Definition annots.h:104
Definition types.h:23
Definition math.h:154
Definition math.h:1029
Definition math.h:1195
Definition math.h:749
Definition fonts.h:32
PDRotate
Specifies degrees of rotation.
Definition types.h:38