public class

PolyLine

extends Line
java.lang.Object
   ↳ com.pdftron.pdf.Annot
     ↳ com.pdftron.pdf.annots.Markup
       ↳ com.pdftron.pdf.annots.Line
         ↳ com.pdftron.pdf.annots.PolyLine
Known Direct Subclasses

Class Overview

Polyline annotations (PDF 1.5) display (open or closed) shapes of multiple edges on the page. Such polylines may have any number of vertices connected by straight lines. For open polylines, which is the default type of polylines, the first and last vertex are not implicitly connected. Closed polylines are polygons, whose first and last vertex are connected.

Summary

Constants
int e_PolyLineDimension The Constant e_PolyLineDimension.
int e_PolygonCloud This integer list specifies the intention of the PolyLine annotation e_PolygonCloud - The annotation is intended to function as a cloud object.
int e_PolygonDimension The Constant e_PolygonDimension.
int e_Unknown The Constant e_Unknown.
[Expand]
Inherited Constants
From class com.pdftron.pdf.annots.Line
From class com.pdftron.pdf.annots.Markup
From class com.pdftron.pdf.Annot
Public Constructors
PolyLine(Obj d)
Creates a PolyLine annotation and initialize it using given Cos/SDF object.
PolyLine()
Creates an empty PolyLine annotation.
PolyLine(Annot annot)
Creates a PolyLine annotation and initialize it using given annotation object.
Public Methods
static PolyLine create(Doc doc, Rect pos)
Creates a new PolyLine annotation, in the specified document.
int getIntentName()
Get the Intent name as an entry from the enum "IntentName" of the annnotation type.
Point getVertex(int idx)
Get the vertex(in Point object form) corresponding to the index within the VErtices array.
int getVertexCount()
Get the number of vertices in the Vertices array.
void setIntentName(int mode)
Set the Intent name as an entry from the enum "IntentName" of the annnotation type.
void setVertex(int idx, Point pt)
Set the vertex(in Point object form) corresponding to the index within the VErtices array.
[Expand]
Inherited Methods
From class com.pdftron.pdf.annots.Line
From class com.pdftron.pdf.annots.Markup
From class com.pdftron.pdf.Annot
From class java.lang.Object

Constants

public static final int e_PolyLineDimension

The Constant e_PolyLineDimension.

Constant Value: 1 (0x00000001)

public static final int e_PolygonCloud

This integer list specifies the intention of the PolyLine annotation e_PolygonCloud - The annotation is intended to function as a cloud object. e_PolyLineDimension(PDF 1.7 ) - The polyline annotation is intended to function as a dimension. e_PolygonDimension(PDF 1.7 ) - The polygon annotation is intended to function as a dimension.

Constant Value: 0 (0x00000000)

public static final int e_PolygonDimension

The Constant e_PolygonDimension.

Constant Value: 2 (0x00000002)

public static final int e_Unknown

The Constant e_Unknown.

Constant Value: 3 (0x00000003)

Public Constructors

public PolyLine (Obj d)

Creates a PolyLine annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
d the input Cos/SDF object

public PolyLine ()

Creates an empty PolyLine annotation.

public PolyLine (Annot annot)

Creates a PolyLine annotation and initialize it using given annotation object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
annot the annot

Public Methods

public static PolyLine create (Doc doc, Rect pos)

Creates a new PolyLine annotation, in the specified document.

Parameters
doc A document to which the PolyLine annotation is added.
pos A rectangle specifying the PolyLine annotation's bounds, specified in user space coordinates.
Returns
  • A newly created blank PolyLine annotation.

public int getIntentName ()

Get the Intent name as an entry from the enum "IntentName" of the annnotation type.

Note: The intent name describes the intent of the polygon or polyline annotation. The following values shall bevalid:

  • e_PolygonCloud - The annotation is intended to function as a cloud object.
  • e_PolyLineDimension(PDF 1.7) - The polyline annotation is intended to function as a dimension.
  • e_PolygonDimension(PDF 1.7) - The polygon annotation is intended to function as a dimension.

Returns
  • the intent nameThe intent name of the annotation as an entry from the enum "IntentName".

public Point getVertex (int idx)

Get the vertex(in Point object form) corresponding to the index within the VErtices array.

Note: The Vertices array is An array of numbers specifying the width and dash pattern that shall represent each vertex in default user space in Point form,

Parameters
idx The index position where the vertex is located.
Returns
  • A Point object corresponding to the vertex in the specified index position.

public int getVertexCount ()

Get the number of vertices in the Vertices array.

Note: The Vertices array is An array of numbers specifying the width and dash pattern that shall represent each vertex in default user space in Point form,

Returns
  • An int indicating the number of vertices.

public void setIntentName (int mode)

Set the Intent name as an entry from the enum "IntentName" of the annnotation type. (Optional; PDF 1.6 )

Note: The intent name describes the intent of the polygon or polyline annotation. The following values shall bevalid: e_PolygonCloud - The annotation is intended to function as a cloud object. e_PolyLineDimension(PDF 1.7) - The polyline annotation is intended to function as a dimension. e_PolygonDimension(PDF 1.7) - The polygon annotation is intended to function as a dimension.

Parameters
mode The intent name of the annotation using an entry from the enum "IntentName".

public void setVertex (int idx, Point pt)

Set the vertex(in Point object form) corresponding to the index within the VErtices array.

Note: The Vertices array is An array of numbers specifying the width and dash pattern that shall represent each vertex in default user space in Point form,

Parameters
idx The index position where the vertex is to be located.
pt A Point object corresponding to the vertex to be added to the array.