|
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.PdfFileAttachmentAnnot
This class represents a file attachment annotation. A file attachment annotation is used to embed attachments attach external files to the PDF document. Users can identify and extract the attachments from the document on the viewer application. The attachment can be a file or a URI. If the contents referred by the URI is volatile, that is, frequently changes with time, then viewer applications can be made not to cache the file and look for the latest copy of the contents.
// Create a PDF page PdfPage page = new PdfPage(); // Create a PDF font PdfFont fontHelvetica = PdfFont.create("Helvetica", 15, PdfEncodings.WINANSI); fontHelvetica.setColor(Color.BLUE); p.writeText("FileAttachment Annotation", font_Helvetica, 220, 400); // Create a file attachment annotation and set its properties PdfFileAttachmentAnnot fileAttachAnnot = new PdfFileAttachmentAnnot( 2, 4, PdfFileAttachmentAnnot.ANNOT_TYPE_FILE_ATTACHMENT, Color.CYAN); fileAttachAnnot.setFilePath("C:\\somefile”); fileAttachAnnot.setBorderStyle(PdfAnnot.ANNOT_TYPE_CIRCLE); fileAttachAnnot.setBorderWidth(2); fileAttachAnnot.setTitle("FileText Annotation Title 1"); fileAttachAnnot.setSubject("FileText Annotation Subject 1"); // Add the annotation to the page page.addAnnotation(fileAttachAnnot);
Field Summary | |
static int |
ICON_GRAPH
Constant specifying an image of a bar graph for the annotation icon. |
static int |
ICON_PAPERCLIP
Constant specifying an image of a paper clip for the annotation icon. |
static int |
ICON_PUSHPIN
Constant specifying an image of a push pin for the annotation icon. |
static int |
ICON_TAG
Constant specifying an image of a price tag for the annotation icon. |
Constructor Summary | |
PdfFileAttachmentAnnot()
Zero-argument default constructor. |
|
PdfFileAttachmentAnnot(double x,
double y,
Color c)
Constructs a file attachment annotation at ( x ,
y ) with specified icon color. |
|
PdfFileAttachmentAnnot(double x,
double y,
int flags)
Constructs a file attachment annotation at (x, y) with specified flags. |
|
PdfFileAttachmentAnnot(double x,
double y,
int flags,
Color c)
Constructs a file attachment annotation at ( x ,
y ) with specified flags and icon color. |
|
PdfFileAttachmentAnnot(double x,
double y,
String subject,
String contents,
String title)
Constructs a file attachment annotation at ( x ,
y ) with specified popup subject, contents, and
title. |
|
PdfFileAttachmentAnnot(double x,
double y,
String subject,
String contents,
String title,
Color c)
Constructs a file attachment annotation at (x, y) with specified icon color, and popup subject, contents and title. |
|
PdfFileAttachmentAnnot(double x,
double y,
String subject,
String contents,
String title,
int flags)
Constructs a file attachment annotation at (x, y) with specified popup subject, contents and title, and flags. |
|
PdfFileAttachmentAnnot(double x,
double y,
String subject,
String contents,
String title,
int flags,
Color c)
Constructs a file attachment annotation at (x, y) with specified popup subject, contents and title, flags, and icon color. |
|
PdfFileAttachmentAnnot(double x,
double y,
String subject,
String contents,
String title,
int flags,
Color c,
String filePath,
boolean isUrl,
boolean isVolatile,
int icon)
Constructs a file attachment annotation at (x, y) with specified icon color, popup subject, contents and title, flags, color, location of attachment, attachment nature, attachment volatality, and icon. |
|
PdfFileAttachmentAnnot(String filePath,
boolean isUrl,
boolean isVolatile,
int icon)
Constructs a file attachment annotation at (x, y) with specified location of attachment, attachment nature, attachment volatality, and icon. |
Method Summary | |
Object |
clone()
|
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. |
String |
getFilePath()
Returns pathname of the file that has specified for the annotation. |
int |
getIcon()
Returns constant specifying the annotation icon. |
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 |
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 |
setFilePath(String filePath)
Specifies file that needs to be used by the annotation. |
void |
setIcon(int icon)
Specifies annotation icon. |
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 ICON_GRAPH
public static final int ICON_PAPERCLIP
public static final int ICON_PUSHPIN
public static final int ICON_TAG
Constructor Detail |
public PdfFileAttachmentAnnot()
public PdfFileAttachmentAnnot(double x, double y, String subject, String contents, String title, int flags, Color c, String filePath, boolean isUrl, boolean isVolatile, int icon) throws IOException, PdfException
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconsubject
- text displayed in the subject line of the
annotation's popup windowcontents
- text displayed as the contents of the annotation's
popup windowtitle
- text displayed in the title in the annotation's
popup windowflags
- annotation attributes
c
- color of the iconfilePath
- location of the attachmentisUrl
- whether the attachment is specified by its pathname
or as a uniform resource identifier (URI)isVolatile
- whether contents of the attachment are volatileicon
- constant specifying the attachment icon
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, String subject, String contents, String title) throws IOException, PdfException
x
,
y
) with specified popup subject, contents, and
title.
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconsubject
- text displayed in the subject line of the
annotation's popup windowcontents
- text displayed as the contents of the annotation's
popup windowtitle
- text displayed in the title in the annotation's
popup window
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, String subject, String contents, String title, Color c) throws IOException, PdfException
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconsubject
- text displayed in the subject line of the
annotation's popup windowcontents
- text displayed as the contents of the annotation's
popup windowtitle
- text displayed in the title in the annotation's
popup windowc
- color of the icon
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, String subject, String contents, String title, int flags) throws IOException, PdfException
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconsubject
- text displayed in the subject line of the
annotation's popup windowcontents
- text displayed as the contents of the annotation's
popup windowtitle
- text displayed in the title in the annotation's
popup windowflags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconsubject
- text displayed in the subject line of the
annotation's popup windowcontents
- text displayed as the contents of the annotation's
popup windowtitle
- text displayed in the title in the annotation's
popup windowflags
- annotation attributes
c
- color of the icon
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, int flags) throws IOException, PdfException
x
- x-coordinate of the location of the icony
- y-coordinate of the location of the iconflags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, int flags, Color c) throws IOException, PdfException
x
,
y
) with specified flags and icon color.
x
- x-coordinate of the location of the icony
- x-coordinate of the location of the iconflags
- annotation attributes
c
- icon color
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(double x, double y, Color c) throws IOException, PdfException
x
,
y
) with specified icon color.
x
- x-coordinate of the location of the icony
- x-coordinate of the location of the iconc
- color of the icon
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfFileAttachmentAnnot(String filePath, boolean isUrl, boolean isVolatile, int icon)
filePath
- location of the attachmentisUrl
- whether the attachment is specified by its pathname
or as a uniform resource identifier (URI)isVolatile
- whether contents of the attachment are volatileicon
- constant specifying the attachment iconMethod Detail |
public Object clone()
public String getFilePath()
writing mode
. In
reading mode
, this method will return
null
.
setFilePath(String)
public void setFilePath(String filePath)
filePath
- pathname of the filegetFilePath()
public int getIcon()
setIcon(int)
public void setIcon(int icon)
icon
- constant specifying the annotation icongetIcon()
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 |