ArkoPDF
← SDK API 參考

ipdf_annots.h

标注:创建、读取、修改与删除各类 PDF 注解,并提取注解数据。

介面說明保留標頭檔裡的英文原文 —— 照文件寫程式時要能一眼對上程式碼裡的註解。

常數

簽章ValueDescription
ANNOT_TYPE_UNKNOW0Unknow type.
ANNOT_TYPE_TEXT1Sticky note.
ANNOT_TYPE_LINK2Link annotation.
ANNOT_TYPE_FREETEXT3Free text annotation
ANNOT_TYPE_LINE4Line annotation
ANNOT_TYPE_SQUARE5Square annotation
ANNOT_TYPE_CIRCLE6Circle annotation
ANNOT_TYPE_POLYGON7Polygon annotation
ANNOT_TYPE_POLYLINE8Polyline annotation
ANNOT_TYPE_INK9Ink annotation
ANNOT_TYPE_HIGHLIGHT10Highlight annotation
ANNOT_TYPE_UNDERLINE11Underline annotation
ANNOT_TYPE_SQUIGGLY12Squiggly annotation
ANNOT_TYPE_STRIKEOUT13Strikeout annotation
ANNOT_TYPE_CARET14Caret annotation
ANNOT_TYPE_STAMP15Stamp annotation
ANNOT_TYPE_POPUP16Popup annotation
ANNOT_TYPE_FILLATTACHMENT17File attachment annotation
ANNOT_TYPE_SOUND18Sound annotation
ANNOT_TYPE_MOVIE19Movie annotation
ANNOT_TYPE_WIDGET20Widget annotation
ANNOT_TYPE_SCREEN21Screen annotation
ANNOT_TYPE_PRINTMARK22PrintmMark annotation
ANNOT_TYPE_TRAPNET23Trapnet annotation
ANNOT_TYPE_WATERMARK24Watermark annotation
ANNOT_TYPE_3D253D annotation
ANNOT_TYPE_REPLACE26Repalce annotation
ANNOT_TYPE_HILIGHTAREA27Hilight Area annotation
ANNOT_TYPE_TEXTBOX28TextBox annotation
ANNOT_TYPE_APK29Apple Pencil Kit annotation
ANNOT_BORDER_NONE0No Border
ANNOT_BORDER_SOLID1(Solid) A solid rectangle surrounding the annotation.
ANNOT_BORDER_BEVELED2(Beveled) A simulated embossed rectangle that appears to be raised above the surface of the page.
ANNOT_BORDER_INSET3(Inset) A simulated engraved rectangle that appears to be recessed below the surface of the page.
ANNOT_BORDER_UNDERLINE4(Underline) A single line along the bottom of the annotation rectangle.
ANNOT_BORDER_DASH5(Dashed)A dashed rectangle surrounding the annotation.
ANNOT_BORDER_EFFECT_NORMAL0No effect.
ANNOT_BORDER_EFFECT_CLOUDY1Cloudy effect.
ANNOT_BORDER_EFFECT_INK2Ink effect.
ANNOT_LINE_ENDINGSTYLE_NONE0No line ending
ANNOT_LINE_ENDINGSTYLE_SQUARE1A square filled with the annotation��s interior color, if any.
ANNOT_LINE_ENDINGSTYLE_CIRCLE2A circle filled with the annotation��s interior color, if any.
ANNOT_LINE_ENDINGSTYLE_DIAMOND3A diamond shape filled with the annotation��s interior color, if any.
ANNOT_LINE_ENDINGSTYLE_OPENARROW4Two short lines meeting in an acute angle to form an open arrowhead.
ANNOT_LINE_ENDINGSTYLE_CLOSEDARROW5Two short lines meeting in an acute angle as in the OpenArrow style and connected by a third line to form a triangular closed arrowhead filled with the annotation��s interior color, if any.
ANNOT_LINE_ENDINGSTYLE_BUTT6A short line at the endpoint perpendicular to the line itself.
ANNOT_LINE_ENDINGSTYLE_ROPENARROPW7Two short lines in the reverse direction from OpenArrow.
ANNOT_LINE_ENDINGSTYLE_RCLOSEDARROW8A triangular closed arrowhead in the reverse direction from ClosedArrow.
ANNOT_LINE_ENDINGSTYLE_SLASH9A short line at the endpoint approximately 30 degrees clockwise from perpendicular to the line itself.
LINK_UNKNOW-1Unknow type.
LINK_DEST0Goto a destination.
LINK_URI1Open a web url.
LINKE_FILEPATH2Open a fileattachment.
ANNOT_APPEARANCE_NORMAL0Normal appearance.
ANNOT_APPEARANCE_ROLLOVER1Rollvoer appearance.
ANNOT_APPEARANCE_DOWN2Down appearance.
ANNOT_FLAG_INVISIBLE1Do not display the annotation if it does not belong to one of the standard annotation types and no annotation handler is available.
ANNOT_FLAG_HIDDEN2Do not display or print the annotation or allow it to interact with the user.
ANNOT_FLAG_PRINT4Do not print the annotation when the page is printed but displaying on the screen.
ANNOT_FLAG_NOZOOM8Do not scale the annotation to match the magnification of the PDF page.
ANNOT_FLAG_NOROTATE0x10Do not rotate the annotation to match the rotation of the page.
ANNOT_FLAG_NOVIEW0x20Do not display the annotation on the screen or allow it to interact with the user.
ANNOT_FLAG_READONLY0x40Do not allow the annotation to interact with the user.
ANNOT_FLAG_LOCKED0x80Do not allow the annotation to be delete or be modified by the user.
ANNOT_FLAG_TOGGLENOVIEW0x100Invert the interpretation of the ANNOT_FLAG_NOVIEW flag for events.
ANNOT_HIGHLIHT_NONE0No highlighting.
ANNOT_HIGHLIHT_INVERT1Invert the contents of the annotation.
ANNOT_HIGHLIHT_OUTLINE2Hilight the annotation��s border.
ANNOT_HIGHLIHT_PUSH3Display the annotation's down appearance, or offset the contents of the annotation rectangle if no down appearance is defined.
ANNOT_SUBTYPE_ARROW1Arrow annotatioin.
ANNOT_SUBTYPE_LINKDEST2Goto destinatioin of link annotatioin.
ANNOT_SUBTYPE_LINKURI3Goto websit of link annotatioin.
ANNOT_SUBTYPE_LINKFILPATH4Open a file attachment of line annotatioin.
ANNOT_SUBTYPE_MARKPEN5Mark Pen annotatioin, a subtype of Ink annotation.
ANNOT_SUBTYPE_AREAHILIGHT6Hilight Area annotatioin, a subtype of Hightlight annotatioin.
ANNOT_SUBTYPE_TEXTBOX7TextBox annotatioin, a subtype of FreeText annotation.

class IPDF_AnnotList

Annotation interface.

方法(17)

簽章說明
Release()Release annotation list
DisplayAnnots(IPDF_Page* page, IPDF_DIBitmap* bitmap, IPDF_Matrix* matrix,…)Display all annotations.
SetFixedIconParams(int nFixedIconType, float sx, float sy, int nRotate)Enable to show icon annotations as fixed size.
GetAnnotMatrix(const IPDF_Annot* annot, const IPDF_Matrix* user2device_matr…)Get annotation matrix from page space to device space.
Count()Count annotations in the annotation list.
GetAnnot(int index)Get an annotation at specified index.
GetIndex(IPDF_Annot* pAnnot)Get annotation's index.
RemoveAll()Remove all the annotations.
RemoveAnnot(IPDF_Annot* pAnnot)Remove the specificed annotation.
RemoveAnnotByAnnotHandler(ANNNOT_HANDLER hander)Remove annotation by the specificed annotation handler.
GetAnnotAt(const PDSDK_FloatPoint& point)Get an annotation by specified position.
GetAnnotByAnnotHandler(ANNNOT_HANDLER hander)Get an annotation by specified handler.
SetDrawingDPI(int x, int y)Set the device DPI.
AddAnnot(int annot_type)Create an annotation by sepcificed type and append to annotation list.
AddAnnotByHandler(int insert_at, ANNNOT_HANDLER annot_handler)Create an annotation by sepcificed hander and insert to annotation list.
AddAnnot(IPDF_Annot* pAnnot)Add an annotation to annotation list.
IsFixedIcon()Check whether to show icon annotations as fixed size.
DisplayAnnots
void DisplayAnnots(IPDF_Page* page, IPDF_DIBitmap* bitmap, IPDF_Matrix* matrix, int showwidget) = 0;

Display all annotations.

參數

  • page(in) — The page it belongs to.
  • bitmap(in) — The bitmap to draw on.
  • matrix(in) — The transformation matrix from user space to device space.
  • showwidget(in) — Whether to show widget or not.
SetFixedIconParams
void SetFixedIconParams(int nFixedIconType, float sx, float sy, int nRotate) = 0;

Enable to show icon annotations as fixed size.

參數

  • nFixedIconType(in) — Indicates how to display fixed annotations. 0 is to show as normal annotations, and 1 is to show as fixed scaling size, and 2 is to show as fixed device size.
  • sx(in) — Fixed size according to the value of <i>nFixedIconType</i> in x axis.
  • sy(in) — Fixed size according to the value of <i>nFixedIconType</i> in y axis.
  • nRotate(in) — Page rotation, valid values are 0, 1, 2, 3.
GetAnnotMatrix
void GetAnnotMatrix(const IPDF_Annot* annot, const IPDF_Matrix* user2device_matrix, IPDF_Matrix* out_matrix) = 0;

Get annotation matrix from page space to device space.

參數

  • annot(in) — The annotation.
  • user2device_matrix(in) — Current displaying transformation matrix.
  • out_matrix(out) — Annotation matrix to display.
GetAnnot
IPDF_Annot* GetAnnot(int index) = 0;

Get an annotation at specified index.

參數

  • index(in) — The zero-based index in the annotation list.

傳回值:An annotation.

GetIndex
int GetIndex(IPDF_Annot* pAnnot) = 0;

Get annotation's index.

參數

  • pAnnot(in) — The input annotation.

傳回值:The zero-based index in the annotation list, -1 for not exist.

RemoveAnnot
void RemoveAnnot(IPDF_Annot* pAnnot) = 0;

Remove the specificed annotation.

參數

  • pAnnot(in) — The annotation to be removed.
RemoveAnnotByAnnotHandler
void RemoveAnnotByAnnotHandler(ANNNOT_HANDLER hander) = 0;

Remove annotation by the specificed annotation handler.

參數

  • hander(in) — The annotation handler.

This method is used to implement Redo/Undo operater of annotation.

GetAnnotAt
IPDF_Annot* GetAnnotAt(const PDSDK_FloatPoint& point) = 0;

Get an annotation by specified position.

參數

  • point(in) — The input position in PDF coordinate.

傳回值:An annotation.

GetAnnotByAnnotHandler
IPDF_Annot* GetAnnotByAnnotHandler(ANNNOT_HANDLER hander) = 0;

Get an annotation by specified handler.

參數

  • hander(in) — The annotation handler.

傳回值:An annotation.

SetDrawingDPI
void SetDrawingDPI(int x, int y) = 0;

Set the device DPI.

參數

  • x(in) — The x-direction DPI.
  • y(in) — The y-direction DPI.
AddAnnot
IPDF_Annot* AddAnnot(int annot_type) = 0;

Create an annotation by sepcificed type and append to annotation list.

參數

  • annot_type(in) — The input annotation type.

傳回值:An annotation.

AddAnnotByHandler
IPDF_Annot* AddAnnotByHandler(int insert_at, ANNNOT_HANDLER annot_handler) = 0;

Create an annotation by sepcificed hander and insert to annotation list.

參數

  • insert_at(in) — The zero-based index to insert at.
  • annot_handler(in) — The input annotation handler.

傳回值:An annotation.

AddAnnot
void AddAnnot(IPDF_Annot* pAnnot) = 0;

Add an annotation to annotation list.

參數

  • pAnnot(in) — The input annotation.

class IPDF_Annot

Annotation Interface.

方法(87)

簽章說明
Release()Release the annotation.
GetType()Get annotation type.@see Annotation Types
GetSubType()Get annotation subtype.@see Annotation Subtypes
SetSubType(int sub_type)Set annotation subtype.
GetFlags()Get annotation flag. @see Annotation Flags
SetFlags(int flags)Set annotation flags.
GetAnnotHandler()Get annotation handler.
GetRect()Get annotation rectangle.
SetRect(PDSDK_FloatRect* rect)Set annotation rectangle.
Move(float dx, float dy)Move the annotatioin.
DrawAnnot(IPDF_Page* page, IPDF_DIBitmap* bitmap, IPDF_Matrix* matrix,…)Draw annotation to a bitmap.
DrawInContext(const IPDF_Page* page, const IPDF_RenderContext* pContext, c…)Draw annotation in a render-context.
DrawAnnot(const IPDF_Page* page, const IPDF_WindowsDevice* pDevice, co…)Draw annotation in Windows Device Context.
GetLineStartingStyle()Get the line-starting style.
SetLineStartingStyle(int style)Set the line-starting style.
GetLineEndingStyle()Get the line-endding style.
SetLineEndingStyle(int style)Set the line-endding style.
SetPoints(PDSDK_FloatPoint* points_array[], int point_count, int subTy…)Set the points to annotation.
GetPointsCount()Get the points count.
GetPoints(PDSDK_FloatPoint* points_array[], int array_length)Get the points of annotation.
GenerateAppearance()Generate the appearance stream of annotation.
GetAnnotName()Get the anntation name.
SetAnnotName(const char* name)Set the anntation name.
GetDate(int creat_or_modify)Get the creation date or modified date of annotation.
SetDate(const char* date, int creat_or_modify)Set the creation date or modified date of annotation.
GetAuthor()Get the author of annotation.
SetAuthor(const wchar_t* author)Set the author of annotation.
SetAuthor(const char* author_utf8)Set the author of annotation, utf8 version.
GetSubject()Get the subject of annotation.
SetSubject(const wchar_t* subject)Set the subject of annotation.
SetSubject(const char* subject_utf8)Set the subject of annotation, utf8 version.
DoEraser(const PDSDK_FloatRect& rect)Eraser the ink annotation.
IsInkPointsInRect(const PDSDK_FloatRect& rect)Test whether the ink annotation is in a rectangle.
ScaleToRect(const PDSDK_FloatRect& dest_rect)Scale annotation to fit a rectangle.
AppendInkPoints(PDSDK_FloatPoint* points_array[], int point_count)Append points to ink annotation.
CountInkPointsSegment()Count the number of segments of ink annotation.
CountInkSegPoints(int iSeg)Count the number of points for sepcificate segment.
GetInkPointsSegmnet(int iSeg, PDSDK_FloatPoint* points_array[], int array_length)Get the points of sepcificated segment.
GetInkSegPathData(int iSeg, IPDF_PathData* path_data)Get the path data sepcificated segment.
GetColor(unsigned int& rgb)Get the border color.
SetColor(unsigned int rgb)Set the border color.
GetFillColor(unsigned int& rgb)Get the fill color.
SetFillColor(unsigned int rgb)Set the fill color.
GetOpacity()Get the opacity.
SetOpacity(float op)Set the opacity.
GetBorderWidth()Get border width.
SetBorderWidth(int width)Set border width.
GetBorderStyle()Get border style.
SetBorderStyle(int style)Set border style.
GetParent()Get parent annotation.
SetParent(IPDF_Annot* pParent)Set parent annotation.
GetPopup()Get popup annotation.
SetPopup(IPDF_Annot* pPopup)Set popup annotation.
SetPopupRect(const PDSDK_FloatRect& rect)Set the positon to show popup annotation.
GetPopupRect(PDSDK_FloatRect& rect)Get the showing rectangel of popup annotation.
SetPopupOpen(int bOpen)Set the open flag of popup annotation.
ContentIsRichText()Test whether the content of annotation is rich text.
GetContents()Get annotation content.
GetContents_UTF8()Get annotation content.
SetContents(const wchar_t* contents, int bRichText)Set annotaion content.
SetContents(const char* contents_utf8, int bRichText)Set annotaion content.
GetIRT()Get IRT annotation.
SetIRT(IPDF_Annot* pIRTAnnot)Set IRT annotation.
GroupWith(IPDF_Annot* pAnnot)Set annotation to group with annother.
GetDestination(PDSDK_Dest& dest)Get the destination of link annotion.
SetDestination(const PDSDK_Dest& dest)Set the destination to link annotion.
SetDestination(const wchar_t* dest_name)Set named destination to link annotion.
GetURI()Get the URI of link annotion.
SetURI(const char* uri)Set the URI of link annotion.
GetFilePath()Get the file path link annotion.
SetFilePath(const wchar_t* path)Set file path of link annotion.
SetFilePath(const char* path_utf8)Set file path of link annotion.
SetHighlightStyle(int nStyle)Set annotation highlight style.
IsPointInAnnot(float x, float y)Test whether a point is in a annotation rectangle.
StartEditText()Enter the edit mode to start edit the annotation text. Used for Type write annotion, Text Box annoation, Call Out annotation
IsPointInEditArea(float x, float y)Test whether a point is in the editable area of annotation.
SetPrivateData(const char* key, const char* value)Set the key-value formatted private data to annotation.
IsKeyExist(const char* key)Test whether a key is exist in annotaion dictionay or the private data mapped by a key is exist.
GetPrivateData(const char* key)Get the key-value formatted private data of annotation.
SetAnnotID(const char* id)Set the unique ID to annotation.
GetAnnotID()Get the unique ID of annotation.
ToXML()Serial annotaiton to XML.
UpdateContent(const wchar_t* new_content, IPDF_Font* font,float font_size,…)—
UpdateContent_UTF8(const char* new_content, IPDF_Font* font, float font_size, u…)—
SetAPKData(const IPDF_DIBitmap* bitmap, const unsigned char* apk_data, …)—
GetAPKPointData(const unsigned char* apk_data, unsigned long len_data)—
GetBounderyPoints(PDSDK_FloatPoint& pt1, PDSDK_FloatPoint& pt2)—
GetType
int GetType() = 0;

Get annotation type.@see Annotation Types

傳回值:The annotation type.

GetSubType
int GetSubType() = 0;

Get annotation subtype.@see Annotation Subtypes

傳回值:The annotation subtype.

SetSubType
void SetSubType(int sub_type) = 0;

Set annotation subtype.

參數

  • sub_type(in) — The annotaion subtypes.@see Annotation Subtypes
GetFlags
int GetFlags() = 0;

Get annotation flag. @see Annotation Flags

傳回值:The annotation flags.

SetFlags
void SetFlags(int flags) = 0;

Set annotation flags.

參數

  • flags(in) — The annotaion flags.@see Annotation Flags
GetAnnotHandler
ANNNOT_HANDLER GetAnnotHandler() = 0;

Get annotation handler.

傳回值:The annotation handler, actually the handler is the dictionary of annotation.

GetRect
PDSDK_FloatRect GetRect() = 0;

Get annotation rectangle.

傳回值:The annotation rectangle.

SetRect
void SetRect(PDSDK_FloatRect* rect) = 0;

Set annotation rectangle.

參數

  • rect(in) — The input rectangle.

The method just valiable for pop-up annotation.

Move
void Move(float dx, float dy) = 0;

Move the annotatioin.

參數

  • dx(in) — The x-direction delta value.
  • dy(in) — The y-direction delta value.
DrawAnnot
void DrawAnnot(IPDF_Page* page, IPDF_DIBitmap* bitmap, IPDF_Matrix* matrix, int nAppearenceMode) = 0;

Draw annotation to a bitmap.

參數

  • page(in) — The page whitch the annotation is belong to.
  • bitmap(in) — The bitmap to display the annotation.
  • matrix(in) — The transform matrix. Normally it is the display matrix for page rendering.
  • nAppearenceMode(in) — The appearance mode.@see Annotation Appearance Mode
DrawInContext
int DrawInContext(const IPDF_Page* page, const IPDF_RenderContext* pContext, const IPDF_Matrix* pUser2Device, int mode) = 0;

Draw annotation in a render-context.

參數

  • page(in) — The page whitch the annotation is belong to.
  • pContext(in) — The rendering context.
  • pUser2Device(in) — The transform matrix. Normally it is the display matrix for page rendering.
  • mode(in) — The appearance mode.@see Annotation Appearance Mode

傳回值:Non-zero for success, otherwise failure.

DrawAnnot
int DrawAnnot(const IPDF_Page* page, const IPDF_WindowsDevice* pDevice, const IPDF_Matrix* matrix, int nAppearenceMode, const RENDER_OPTION* opts) = 0;

Draw annotation in Windows Device Context.

參數

  • page(in) — The page whitch the annotation is belong to.
  • pDevice(in) — The Windows DC to display the annotation.
  • matrix(in) — The transform matrix. Normally it is the display matrix for page rendering.
  • nAppearenceMode(in) — The appearance mode.@see Annotation Appearance Mode
  • opts(in) — The rendering options.Can not be NULL.

傳回值:Non-zero for success, otherwise failure.

GetLineStartingStyle
int GetLineStartingStyle() = 0;

Get the line-starting style.

傳回值:The line-starting style.

见 Annotation Line Endding Style

SetLineStartingStyle
void SetLineStartingStyle(int style) = 0;

Set the line-starting style.

參數

  • style(in) — The line-starting style.@see Annotation Line Endding Style
GetLineEndingStyle
int GetLineEndingStyle() = 0;

Get the line-endding style.

傳回值:The line-endding style.

见 Annotation Line Endding Style

SetLineEndingStyle
void SetLineEndingStyle(int style) = 0;

Set the line-endding style.

參數

  • style(in) — The line-starting style.@see Annotation Line Endding Style
SetPoints
int SetPoints(PDSDK_FloatPoint* points_array[], int point_count, int subType = 0) = 0;

Set the points to annotation.

參數

  • points_array(in) — The input points. Line annotation: points_array has only two points, specificate the moveto point and lineto piont, if arrow annot, subType is 1.\n Square annotation: points_array has only two points specificate (left, bottom) and (right, top).\n Circle annotation: points_array has only two points specificate (left, bottom) and (right, top), means specificate the BBox of Cricle.\n Polygon annotation: points_array and point_count spcificate the points use to make a polygon.\n Polyline annotation: points_array and point_count spcificate the points use to make a polyline.\n Ink annotation:(x1, y1, x2, y2, ..., xn, yn), point_count = n / 2;\n Markup annotation(Highlight, Underline, Strikeout, Squiggly): points_array has n * 4 points specificate the boxies, the points order of a box is (left, top)(right, top)(left,bottom)(right bottom).\n Caret annotation: points_array has only two points specificate (left, bottom) and (right, top).\n StickNote annotation: points_array has two points as the bounding-box:(left, bottom, right, top).\n
  • point_count(in) — The point count of points_array.
  • subType(in) — The subtype of annotation.Just used for Arrow annotation.

傳回值:Zero for failure, Non-zero for success.

GetPointsCount
int GetPointsCount() = 0;

Get the points count.

傳回值:The number of points.

for StickNote, return two:(left, bottom), (right, top).

GetPoints
int GetPoints(PDSDK_FloatPoint* points_array[], int array_length) = 0;

Get the points of annotation.

參數

  • points_array(in/out) — The points array. It should be filled by PDSDK_FloatPoint object.
  • array_length(in) — The length of points_array.

傳回值:The actual readed number of points..

GenerateAppearance
void GenerateAppearance() = 0;

Generate the appearance stream of annotation.

When use @see SetPoints() to change the annotation appearance, we need generate the appearance stream before PDF documet saving.

GetAnnotName
const char* GetAnnotName() = 0;

Get the anntation name.

傳回值:The annotation name, a text string uniquely identifying it among all the annotations on its page.

SetAnnotName
void SetAnnotName(const char* name) = 0;

Set the anntation name.

參數

  • name(in) — The input name.
GetDate
const char* GetDate(int creat_or_modify) = 0;

Get the creation date or modified date of annotation.

參數

  • creat_or_modify(in) — Zero for creation date, 1 for modified date.

傳回值:The date string. The format of date string is (D:YYYYMMDDHHmmSSOHH'mm').

SetDate
void SetDate(const char* date, int creat_or_modify) = 0;

Set the creation date or modified date of annotation.

參數

  • date(in) — The date string(YYYYMMDDHHmmSSOHH'mm').
  • creat_or_modify(in) — Zero for creation date, 1 for modified date.
GetAuthor
const wchar_t* GetAuthor() = 0;

Get the author of annotation.

傳回值:The author(unicode).

SetAuthor
void SetAuthor(const wchar_t* author) = 0;

Set the author of annotation.

參數

  • author(in) — The input author(unicode).
SetAuthor
void SetAuthor(const char* author_utf8) = 0;

Set the author of annotation, utf8 version.

參數

  • author(in) — The input author(utf8).
GetSubject
const wchar_t* GetSubject() = 0;

Get the subject of annotation.

傳回值:The subject(unicode).

SetSubject
void SetSubject(const wchar_t* subject) = 0;

Set the subject of annotation.

參數

  • subject(in) — The input subject(unicode).
SetSubject
void SetSubject(const char* subject_utf8) = 0;

Set the subject of annotation, utf8 version.

參數

  • subject(in) — The input subject(utf8).
DoEraser
int DoEraser(const PDSDK_FloatRect& rect) = 0;

Eraser the ink annotation.

參數

  • rect(in) — Spcificate the rectangle area to be eraser.
IsInkPointsInRect
int IsInkPointsInRect(const PDSDK_FloatRect& rect) = 0;

Test whether the ink annotation is in a rectangle.

參數

  • rect(in) — The input rectangle.
ScaleToRect
void ScaleToRect(const PDSDK_FloatRect& dest_rect) = 0;

Scale annotation to fit a rectangle.

參數

  • dest_rect(in) — The input destination rectangle.
AppendInkPoints
void AppendInkPoints(PDSDK_FloatPoint* points_array[], int point_count) = 0;

Append points to ink annotation.

參數

  • points_array(in) — The points array. It should be filled by PDSDK_FloatPoint object.
  • point_count(in) — The length of points_array.
CountInkPointsSegment
int CountInkPointsSegment() = 0;

Count the number of segments of ink annotation.

傳回值:The number of segments.

CountInkSegPoints
int CountInkSegPoints(int iSeg) = 0;

Count the number of points for sepcificate segment.

參數

  • iSeg(in) — The segment index.

傳回值:The number of the segment specificated by iSeg.

GetInkPointsSegmnet
int GetInkPointsSegmnet(int iSeg, PDSDK_FloatPoint* points_array[], int array_length) = 0;

Get the points of sepcificated segment.

參數

  • iSeg(in) — The segment index.
  • points_array(in/out) — The array to receiv the points.
  • array_length(in) — The length of array points_array.

傳回值:The number of the segment specificated by iSeg.

GetInkSegPathData
int GetInkSegPathData(int iSeg, IPDF_PathData* path_data) = 0;

Get the path data sepcificated segment.

參數

  • iSeg(in) — The segment index.
  • path_data(in) — The path data with iSeg.

傳回值:The number of the segment specificated by iSeg.

GetColor
int GetColor(unsigned int& rgb) = 0;

Get the border color.

參數

  • rgb(in/out) — The border color.

傳回值:0 means no color.

SetColor
void SetColor(unsigned int rgb) = 0;

Set the border color.

參數

  • rgb(in) — The border color.
GetFillColor
int GetFillColor(unsigned int& rgb) = 0;

Get the fill color.

參數

  • rgb(in/out) — The fill color.

傳回值:0 means no color.

SetFillColor
void SetFillColor(unsigned int rgb) = 0;

Set the fill color.

參數

  • rgb(in) — The fill color.
GetOpacity
float GetOpacity() = 0;

Get the opacity.

傳回值:The opacity from 0.0 to 1.0.

SetOpacity
void SetOpacity(float op) = 0;

Set the opacity.

參數

  • op(in) — The opacity(0.0-1.0).
GetBorderWidth
int GetBorderWidth() = 0;

Get border width.

傳回值:The border width.

SetBorderWidth
void SetBorderWidth(int width) = 0;

Set border width.

參數

  • width(in) — The border width.
GetBorderStyle
int GetBorderStyle() = 0;

Get border style.

傳回值:The border style.

见 Annotation Border Styles

SetBorderStyle
void SetBorderStyle(int style) = 0;

Set border style.

參數

  • width(in) — The border style.@see Annotation Border Styles
GetParent
IPDF_Annot* GetParent() = 0;

Get parent annotation.

傳回值:The parent annotation.

SetParent
void SetParent(IPDF_Annot* pParent) = 0;

Set parent annotation.

參數

  • pParent(in) — The parent annotation.
GetPopup
IPDF_Annot* GetPopup() = 0;

Get popup annotation.

傳回值:The popup annotation.

SetPopup
void SetPopup(IPDF_Annot* pPopup) = 0;

Set popup annotation.

參數

  • pPopup(in) — The popup annotation.
SetPopupRect
void SetPopupRect(const PDSDK_FloatRect& rect) = 0;

Set the positon to show popup annotation.

參數

  • rect(in) — A rectangle to specified the showing area of popup annotation.
GetPopupRect
void GetPopupRect(PDSDK_FloatRect& rect) = 0;

Get the showing rectangel of popup annotation.

參數

  • rect(out) — The rectangle of popup annotation.
SetPopupOpen
void SetPopupOpen(int bOpen) = 0;

Set the open flag of popup annotation.

參數

  • bOpen(in) — The popup open flag. 1 for open when display, 0 for closed.
ContentIsRichText
int ContentIsRichText() = 0;

Test whether the content of annotation is rich text.

傳回值:1 for rich text, otherwise not.

GetContents
const wchar_t* GetContents() = 0;

Get annotation content.

傳回值:The unicode content.

GetContents_UTF8
const char* GetContents_UTF8() = 0;

Get annotation content.

傳回值:The UTF-8 content.

SetContents
void SetContents(const wchar_t* contents, int bRichText) = 0;

Set annotaion content.

參數

  • contents(in) — The unicode encodding content of annotation.
  • bRichText(in) — The rich text flag,1 for rich text, otherwise not.
SetContents
void SetContents(const char* contents_utf8, int bRichText) = 0;

Set annotaion content.

參數

  • contents(in) — The UTF-8 encodding content of annotation.
  • bRichText(in) — The rich text flag,1 for rich text, otherwise not.
GetIRT
ANNNOT_HANDLER GetIRT() = 0;

Get IRT annotation.

傳回值:The IRT annotation.

SetIRT
void SetIRT(IPDF_Annot* pIRTAnnot) = 0;

Set IRT annotation.

參數

  • pIRTAnnot(in) — The IRT annotation.
GroupWith
void GroupWith(IPDF_Annot* pAnnot) = 0;

Set annotation to group with annother.

參數

  • pAnnot(in) — The annotation to be grouped with.
GetDestination
int GetDestination(PDSDK_Dest& dest) = 0;

Get the destination of link annotion.

參數

  • dest(out) — The desitination.@see PDF destination structure
SetDestination
void SetDestination(const PDSDK_Dest& dest) = 0;

Set the destination to link annotion.

參數

  • dest(in) — The desitination.@see PDF destination structure
SetDestination
int SetDestination(const wchar_t* dest_name) = 0;

Set named destination to link annotion.

參數

  • dest_name(in) — The named desitination.
GetURI
const char* GetURI() = 0;

Get the URI of link annotion.

傳回值:The URI string.

SetURI
void SetURI(const char* uri) = 0;

Set the URI of link annotion.

參數

  • uri(in) — The URI string.
GetFilePath
const wchar_t* GetFilePath() = 0;

Get the file path link annotion.

傳回值:The file path encodding by unicode .

SetFilePath
void SetFilePath(const wchar_t* path) = 0;

Set file path of link annotion.

參數

  • path(in) — The unicode encodding file path.
SetFilePath
void SetFilePath(const char* path_utf8) = 0;

Set file path of link annotion.

參數

  • path(in) — The utf8 encodding file path.
SetHighlightStyle
void SetHighlightStyle(int nStyle) = 0;

Set annotation highlight style.

參數

  • nStyle(in) — The highlight style. @see Annotation Highlighting mode
IsPointInAnnot
int IsPointInAnnot(float x, float y) = 0;

Test whether a point is in a annotation rectangle.

參數

  • x(in) — The x component of point.
  • y(in) — The y component of point.

傳回值:1 for in annotation rectangle, 0 for not in .

StartEditText
IPDF_Paragraph* StartEditText() = 0;

Enter the edit mode to start edit the annotation text. Used for Type write annotion, Text Box annoation, Call Out annotation

參數

  • nStyle(in) — The highlight style. @see Annotation Highlighting mode

傳回值:The editable paragraph interface.

IsPointInEditArea
int IsPointInEditArea(float x, float y) = 0;

Test whether a point is in the editable area of annotation.

參數

  • x(in) — The x component of point.
  • y(in) — The y component of point.

傳回值:1 for in editable area, 0 for not in .

SetPrivateData
void SetPrivateData(const char* key, const char* value) = 0;

Set the key-value formatted private data to annotation.

參數

  • key(in) — The key of private data.
  • value(in) — The value of private data.

傳回值:1 for in editable area, 0 for not in .

IsKeyExist
int IsKeyExist(const char* key) = 0;

Test whether a key is exist in annotaion dictionay or the private data mapped by a key is exist.

參數

  • key(in) — The key to test.

傳回值:1 for exist, 0 for not exist .

GetPrivateData
const char* GetPrivateData(const char* key) = 0;

Get the key-value formatted private data of annotation.

參數

  • key(in) — The key of private data.

傳回值:The value of private data .

SetAnnotID
void SetAnnotID(const char* id) = 0;

Set the unique ID to annotation.

參數

  • id(in) — The unique ID.

傳回值:The value of private data .

GetAnnotID
const char* GetAnnotID() = 0;

Get the unique ID of annotation.

傳回值:The unique ID of annotation.

ToXML
iAmd_XmlElement* ToXML() = 0;

Serial annotaiton to XML.

傳回值:A XML element.