|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfProAnnot
com.gnostice.pdfone.PdfFreeTextAnnot
This class represents a free text annotation. A free text
annotation is displayed directly on the page. The "content" text
for the annotation is displayed on the page. A
callout line
can be associated
with the annotation rectangle of the free text annotation.
PdfWriter writer1 = PdfWriter.fileWriter( new File("PdfFreeTextAnnot_example.pdf")); PdfDocument doc1 = new PdfDocument(writer1); PdfPage p1 = new PdfPage(); doc1.add(p1); // Create a free text annotation PdfFreeTextAnnot fta1 = new PdfFreeTextAnnot( new PdfRect(100,100,200,50), "subject line text", "content text", "title text", PdfAnnot.FLAG_PRINT, Color.YELLOW, PdfFreeTextAnnot.ALIGNMENT_CENTER); double cl1[] = {300,100, 300,150, 350,250}; // Set properties of the annotation fta1.setCalloutLine(cl1); fta1.setIntent(PdfFreeTextAnnot.INTENT_FREETEXT_CALLOUT); // Add annotation to the document doc1.addAnnotation(fta1, 1); // Mark the annotation doc1.writeText(".(300, 100) starting", 300,100); doc1.writeText(".(300, 150) ending ", 300,150); doc1.writeText(".(350, 250) knee", 350,250); doc1.setOpenAfterSave(true); doc1.write(); writer1.dispose();
Field Summary | |
static int |
ALIGNMENT_CENTER
Constant for align of text contents of the free-text annotation to the center. |
static int |
ALIGNMENT_LEFT
Constant for align of text contents of the free-text annotation to the left. |
static int |
ALIGNMENT_RIGHT
Constant for align of text contents of the free-text annotation to the right margin. |
static int |
INTENT_FREETEXT_CALLOUT
Constant for specifying that free text annotation needs to be used as a callout. |
static int |
INTENT_FREETEXT_TYPEWRITER
|
Constructor Summary | |
PdfFreeTextAnnot()
Zero-argument default constructor. |
|
PdfFreeTextAnnot(PdfRect r,
Color c)
Creates a free text annotation with specified annotation rectangle and background color. |
|
PdfFreeTextAnnot(PdfRect r,
int flags)
Creates a free text annotation with specified annotation rectangle and annotation attributes. |
|
PdfFreeTextAnnot(PdfRect r,
int flags,
Color c)
Creates a free text annotation with specified annotation rectangle, annotation attributes, and background color. |
|
PdfFreeTextAnnot(PdfRect r,
String subject,
String contents,
String title)
Creates a free text annotation with specified annotation rectangle, subject text, displayed text content, and title text. |
|
PdfFreeTextAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Creates a free text annotation with specified annotation rectangle, subject text, displayed text content, title text, and background color. |
|
PdfFreeTextAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Creates a free text annotation with specified annotation rectangle, subject text, displayed text content, title text, and annotation attributes. |
|
PdfFreeTextAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
Creates a free text annotation with specified annotation rectangle, subject text, displayed text content, title text, annotation attributes, and background color. |
|
PdfFreeTextAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int alignment)
Creates a free text annotation with specified annotation rectangle, subject text, displayed text content, title text, annotation attributes, background color, and text alignment of the displayed text. |
Method Summary | |
Object |
clone()
|
int |
getAlignment()
Returns how text is aligned inside the annotation rectangle. |
double[] |
getCalloutLine()
Returns x-y coordinates of the starting, end, and knee-bend locations of the callout line of the free text annotation. |
PdfAppearanceStream |
getDownAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
int |
getIntent()
Returns constant identifying the function of the free text annotation. |
PdfAppearanceStream |
getNormalAppearance()
Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
PdfPopUpAnnot |
getPopup()
Returns a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
PdfAppearanceStream |
getRolloverAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button). |
float |
getTransparency()
|
void |
setAlignment(int alignment)
Specifies how text needs to be aligned inside the annotation rectangle. |
void |
setCalloutLine(double[] calloutLine)
Specifies x-y coordinates of the starting, end, and knee-bend locations of the callout line of the free text annotation. |
void |
setDownAppearance(PdfAppearanceStream downAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
void |
setIntent(int intent)
Specifies constant identifying the function of the free text annotation. |
void |
setNormalAppearance(PdfAppearanceStream normalAppearance)
Specifies the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
void |
setPopup(PdfPopUpAnnot popup,
boolean overridePopUpProperties)
Specifies a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
void |
setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field (and does not hold down the mouse button). |
void |
setTransparency(float transparecyLevel)
|
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, getType, hashCode, isDeleted, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setRect, setRect, setRect, setRect, setRect, setShowRect, setSubject, setTitle |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALIGNMENT_LEFT
public static final int ALIGNMENT_CENTER
public static final int ALIGNMENT_RIGHT
public static final int INTENT_FREETEXT_CALLOUT
public static final int INTENT_FREETEXT_TYPEWRITER
Constructor Detail |
public PdfFreeTextAnnot() throws IOException, PdfException
public PdfFreeTextAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c, int alignment) throws IOException, PdfException
r
- annotation rectanglesubject
- text that needs to be used as subject of the free
text annotationcontents
- text that needs to be directly displayed on the pagetitle
- text that needs to be used as title of the free text
annotationflags
- annotation attributes
c
- background-color of the free text annotationalignment
- alignment of the text inside the free text
annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, String subject, String contents, String title) throws IOException, PdfException
r
- annotation rectanglesubject
- text that needs to be used as subject of the free
text annotationcontents
- text that needs to be directly displayed on the pagetitle
- text that needs to be used as title of the free text
annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, String subject, String contents, String title, Color c) throws IOException, PdfException
r
- annotation rectanglesubject
- text that needs to be used as subject of the free
text annotationcontents
- text that needs to be directly displayed on the pagetitle
- text that needs to be used as title of the free text
annotationc
- background-color of the free text annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, String subject, String contents, String title, int flags) throws IOException, PdfException
r
- annotation rectanglesubject
- text that needs to be used as subject of the free
text annotationcontents
- text that needs to be directly displayed on the pagetitle
- text that needs to be used as title of the free text
annotationflags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
r
- annotation rectanglesubject
- text that needs to be used as subject of the free
text annotationcontents
- text that needs to be directly displayed on the pagetitle
- text that needs to be used as title of the free text
annotationflags
- annotation attributes
c
- background-color of the free text annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, int flags) throws IOException, PdfException
r
- annotation rectangleflags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, int flags, Color c) throws IOException, PdfException
r
- annotation rectangleflags
- annotation attributes
c
- background-color of the free text annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFreeTextAnnot(PdfRect r, Color c) throws IOException, PdfException
r
- annotation rectanglec
- background-color of the free text annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.Method Detail |
public Object clone()
public int getAlignment()
constant
specifying text
alignmentsetAlignment(int)
public void setAlignment(int alignment)
alignment
- constant
specifying text
alignmentgetAlignment()
public double[] getCalloutLine()
setCalloutLine(double[])
public void setCalloutLine(double[] calloutLine)
calloutLine
- x-y coordinates of starting, end, and knee-bend
locations of the callout linegetCalloutLine()
public int getIntent()
setAlignment(int)
public void setIntent(int intent)
intent
- constant identifying the function of the free text
annotationgetIntent()
public void setTransparency(float transparecyLevel)
public float getTransparency()
public PdfPopUpAnnot getPopup()
public void setPopup(PdfPopUpAnnot popup, boolean overridePopUpProperties)
popup
- popup annotation that needs to be used as the popup
windowoverridePopUpProperties
- whether a viewer application should override the
properties of the popup annotation with those of
this annotationPdfProAnnot.getPopup()
public PdfAppearanceStream getDownAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
public void setDownAppearance(PdfAppearanceStream downAppearance)
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public PdfAppearanceStream getNormalAppearance()
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setNormalAppearance(PdfAppearanceStream normalAppearance)
normalAppearance
- the specified appearance streamPdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
public PdfAppearanceStream getRolloverAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
rolloverAppearance
- the specified appearance streamPdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |