public class Ink extends Markup
Annot.BorderStyle
e_3D, e_action_trigger_activate, e_action_trigger_annot_blur, e_action_trigger_annot_down, e_action_trigger_annot_enter, e_action_trigger_annot_exit, e_action_trigger_annot_focus, e_action_trigger_annot_page_close, e_action_trigger_annot_page_invisible, e_action_trigger_annot_page_open, e_action_trigger_annot_page_visible, e_action_trigger_annot_up, e_Caret, e_Circle, e_down, e_FileAttachment, e_FreeText, e_hidden, e_Highlight, e_Ink, e_invisible, e_Line, e_Link, e_locked, e_locked_contents, e_Movie, e_no_rotate, e_no_view, e_no_zoom, e_normal, e_Polygon, e_Polyline, e_Popup, e_print, e_PrinterMark, e_Projection, e_read_only, e_Redact, e_RichMedia, e_rollover, e_Screen, e_Sound, e_Square, e_Squiggly, e_Stamp, e_StrikeOut, e_Text, e_toggle_no_view, e_TrapNet, e_Underline, e_Unknown, e_Watermark, e_Widget
Constructor and Description |
---|
Ink()
Creates an empty Ink annotation.
|
Ink(Annot annot)
Creates an Ink annotation and initialize it using given annotation object.
|
Ink(Obj d)
Creates an Ink annotation and initialize it using given Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static Ink |
create(Doc doc,
Rect pos)
Creates a new Ink annotation, in the specified document.
|
boolean |
erase(Point pt1,
Point pt2,
double eraserHalfWidth)
Erase a rectangle area formed by pt1pt2 with width
|
static boolean |
erasePoints(Obj sdfObj,
Rect rect,
Point pt1,
Point pt2,
double eraserHalfWidth)
Erase a rectangle area formed by pt1pt2 with width from the SDF object
|
static double[] |
getBezierControlPoints(double[] polyline)
Returns an array of Bezier Control Points for smoothing the given polyline
|
int |
getPathCount()
Get number of stroked pathes in the InkList.
|
Point |
GetPoint(int pathindex,
int pointindex)
Get the specific point in the Ink List.
|
int |
getPointCount(int pathindex)
Get number of points in a certain stroked path in the InkList.
|
boolean |
getSmoothing()
Gets whether smoothing should be used then refreshing the inks appearance
|
void |
setPoint(int pathindex,
int pointindex,
Point pt)
Set the specific point in the Ink List.
|
void |
setSmoothing(boolean smoothing)
Sets whether smoothing should be used then refreshing the inks appearance
|
getBorderEffect, getBorderEffectIntensity, getContentRect, getCreationDates, getInteriorColor, getInteriorColorCompNum, getOpacity, getPadding, getPopup, getSubject, getTitle, setBorderEffect, SetBorderEffectIntensity, setContentRect, setCreationDates, setInteriorColor, setOpacity, SetPadding, setPopup, setSubject, setTitle
__Create, __GetHandle, __GetRefHandle, create, equals, flatten, getActiveAppearanceState, getAppearance, getAppearance, getAppearance, getBorderStyle, getColorAsCMYK, getColorAsGray, getColorAsRGB, getColorCompNum, getContents, getDate, getFlag, getOptionalContent, getPage, getRect, getRotation, getSDFObj, GetStructParent, getTriggerAction, getType, getUniqueID, getVisibleContentBox, isMarkup, isValid, refreshAppearance, removeAppearance, resize, setActiveAppearanceState, setAppearance, setAppearance, setAppearance, setBorderStyle, setColor, setContents, setDate, setFlag, setOptionalContent, setPage, setRect, setRotation, setStructParent, setUniqueID
public Ink(Obj d)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d
- the input Cos/SDF objectpublic Ink()
public Ink(Annot annot) throws PDFNetException
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
annot
- the annotPDFNetException
public static Ink create(Doc doc, Rect pos) throws PDFNetException
doc
- A document to which the Ink annotation is added.pos
- A rectangle specifying the Ink annotation's bounds, specified in
user space coordinates.PDFNetException
public int getPathCount() throws PDFNetException
Note: The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
PDFNetException
public int getPointCount(int pathindex) throws PDFNetException
Note: The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
pathindex
- An unsigned integer indicating the index of the stroked
path, the number of points within whom is of our interest.PDFNetException
public Point GetPoint(int pathindex, int pointindex) throws PDFNetException
Note: The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
pathindex
- An unsigned integer indicating the index of the stroked
pathpointindex
- An unsigned integer indicating the index of the point
within the stroked path indicated by the parameter "pathindex".PDFNetException
public void setPoint(int pathindex, int pointindex, Point pt) throws PDFNetException
Note: The Ink list is An array of n arrays, each representing a stroked path. Each array shall be a series of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.
pathindex
- An unsigned integer indicating the index of the stroked
pathpointindex
- An unsigned integer indicating the index of the point
within the stroked path indicated by the parameter "pathindex".pt
- A Point object that is to be located by "pathindex" and "pointindex".PDFNetException
public boolean erase(Point pt1, Point pt2, double eraserHalfWidth) throws PDFNetException
pt1
- A point object that is one end of the eraser segmentpt2
- A point object that is the other end of the eraser segmenteraserHalfWidth
- The half width of the eraserPDFNetException
public static boolean erasePoints(Obj sdfObj, Rect rect, Point pt1, Point pt2, double eraserHalfWidth) throws PDFNetException
sdfObj
- An SDF object containing points on which the erase will be performedpt1
- A point object that is one end of the eraser segmentpt2
- A point object that is the other end of the eraser segmenteraserHalfWidth
- The half width of the eraserPDFNetException
public boolean getSmoothing() throws PDFNetException
PDFNetException
public void setSmoothing(boolean smoothing) throws PDFNetException
smoothing
- A bool indicating whether smoothing should be used (true by default).PDFNetException
public static double[] getBezierControlPoints(double[] polyline) throws PDFNetException
polyline
- A double array of points that form a polylinePDFNetException