pdftron::PDF::Annots::Ink Class Reference

An ink annotation (PDF 1.3) represents a freehand “scribble” composed of one or more disjoint paths. More...

#include <Ink.h>

Inheritance diagram for pdftron::PDF::Annots::Ink:

Inheritance graph
[legend]
Collaboration diagram for pdftron::PDF::Annots::Ink:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Ink (SDF::Obj d=0)
 Creates an Ink annotation and initializes it using given Cos/SDF object.
 Ink (const Annot &ann)
 Creates an Ink annotation and initializes it using given annotation object.
int GetPathCount () const
 Returns number of paths in the annotation.
int GetPointCount (unsigned int pathindex) const
 Returns number of points in a certain stroked path in the InkList.
Point GetPoint (unsigned int pathindex, unsigned int pointindex) const
 Returns the specific point in a given path.
void SetPoint (unsigned int pathindex, unsigned int pointindex, const Point &pt)
 Sets the specific point in the Ink List, adding it if needed.

Static Public Member Functions

static Ink Create (SDF::SDFDoc &doc, const Rect &pos)
 Creates a new Ink annotation in the specified document.


Detailed Description

An ink annotation (PDF 1.3) represents a freehand “scribble” composed of one or more disjoint paths.

When opened, it shall display a pop-up window containing the text of the associated note.


Constructor & Destructor Documentation

pdftron::PDF::Annots::Ink::Ink ( SDF::Obj  d = 0  ) 

Creates an Ink annotation and initializes it using given Cos/SDF object.

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

pdftron::PDF::Annots::Ink::Ink ( const Annot ann  )  [inline]

Creates an Ink annotation and initializes it using given annotation object.

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


Member Function Documentation

static Ink pdftron::PDF::Annots::Ink::Create ( SDF::SDFDoc doc,
const Rect pos 
) [static]

Creates a new Ink annotation in the specified document.

Parameters:
doc A document to which the Ink annotation is added.
pos A rectangle specifying the Ink annotation's bounds in default user space units.
Returns:
A newly created blank Ink annotation.

int pdftron::PDF::Annots::Ink::GetPathCount (  )  const

Returns number of paths in the annotation.

Returns:
An integer representing the number of paths in the 'InkList' entry of the annotation dictionary.
Note:
Each path is an array 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.

int pdftron::PDF::Annots::Ink::GetPointCount ( unsigned int  pathindex  )  const

Returns number of points in a certain stroked path in the InkList.

Parameters:
pathindex path index for each the point count is returned. Index starts at 0.
Returns:
An integer representing the number of points in the stroked path of the Ink list.
See also:
GetPathCount()

Point pdftron::PDF::Annots::Ink::GetPoint ( unsigned int  pathindex,
unsigned int  pointindex 
) const

Returns the specific point in a given path.

Parameters:
pathindex path index for each the point is returned. Index starts at 0.
pointindex index of point in the path. Index starts at 0.
Returns:
A Point object for specified path and point index.
Note:
Each path is an array 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.

void pdftron::PDF::Annots::Ink::SetPoint ( unsigned int  pathindex,
unsigned int  pointindex,
const Point pt 
)

Sets the specific point in the Ink List, adding it if needed.

Parameters:
pathindex An unsigned integer indicating the index of the path.
pointindex 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 assigned.
Note:
Ink annotation contains an array of paths. Each path is an array 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.


© 2002-2010 PDFTron Systems Inc.