|
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.PdfWatermarkAnnot
This class represents a watermark annotation. A
PdfAppearanceStream
object is displayed by the watermark annotation. The contents of
the appearance stream object used by the watermark annotation
may
A watermark annotation does not have a popup window.
When a page is printed, it may be required the watermark annotation
is repositioned relative to the size of the printer paper. This
requirement can be turned on and off using setFixedPrint(boolean)
.
The relative vertical position of the watermark
can be specified using setVerticalTranslation(double)
.
The relative horizontal position can be specified using
setHorizontalTranslation(double)
.
PdfFont fontHelvetica = PdfFont.create("Helvetica", 75, PdfEncodings.WINANSI); PdfTextFormatter tf = new PdfTextFormatter(); // Create an appearance stream PdfAppearanceStream ap1 = new PdfAppearanceStream(new PdfRect(0, 0, 1000, 1000)); ap1.writeText("WaterMarkAnnotation Demo", fontHelvetica, new PdfRect(0, 200, 1000, 1000), tf); // Create a watermark annotation PdfWatermarkAnnot waterAnnot1 = new PdfWatermarkAnnot( new PdfRect(0, 0, 100, 100), 0.5f, 0.5f, PdfWatermarkAnnot.ANNOT_TYPE_WATERMARK); waterAnnot1.setContents("WaterMark Demo"); waterAnnot1.setColor(java.awt.Color.BLUE); waterAnnot1.setNormalAppearance(ap1); // Create a PDF page PdfPage page = new PdfPage(); // Add the annotation to the page page.addAnnotation(waterAnnot1);
Field Summary |
Constructor Summary | |
PdfWatermarkAnnot()
|
|
PdfWatermarkAnnot(PdfRect r,
double horizontalTranslation,
double verticalTranslation,
int flags)
Creates a new watermark with specified annotation rectangle, relative position on printer page, and annotation attributes. |
|
PdfWatermarkAnnot(PdfRect r,
int flags)
Creates a new watermark with specified annotation rectangle and attributes. |
Method Summary | |
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. |
double |
getHorizontalTranslation()
Returns horizontal position of top-left corner of the watermark relative to the printer page width. |
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). |
double |
getVerticalTranslation()
Returns vertical position of top-left corner of the watermark relative to the printer page height. |
boolean |
isFixedPrint()
Returns whether the watermark is printed relative to the size of the printer page. |
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 |
setFixedPrint(boolean isFixedPrint)
Specifies whether the watermark needs to be printed relative to the size of the printer page. |
void |
setHorizontalTranslation(double horizontalTranslation)
Specifies horizontal position of top-left corner of the watermark relative to the printer page width. |
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 |
setVerticalTranslation(double verticalTranslation)
Specifies vertical position of top-left corner of the watermark relative to the printer page height. |
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 |
Constructor Detail |
public PdfWatermarkAnnot()
public PdfWatermarkAnnot(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 PdfWatermarkAnnot(PdfRect r, double horizontalTranslation, double verticalTranslation, int flags) throws IOException, PdfException
r
- annotation rectanglehorizontalTranslation
- a value between 0.0 and 1.0 (where 0.0 would set the
corner to the left edge of the page and 1.0 would
set it at the right edge of the page)verticalTranslation
- a value between 0.0 and 1.0 (where 0.0 would set the
corner to the top edge of the page and 1.0 would set
it at the bottom-edge of the page)flags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.Method Detail |
public double getHorizontalTranslation()
setHorizontalTranslation(double)
,
getVerticalTranslation()
public void setHorizontalTranslation(double horizontalTranslation)
horizontalTranslation
- a value between 0.0 and 1.0 (where 0.0 would set the
corner to the left edge of the page and 1.0 would set
it at the right edge of the page)getHorizontalTranslation()
,
setVerticalTranslation(double)
public double getVerticalTranslation()
setVerticalTranslation(double)
,
getHorizontalTranslation()
public void setVerticalTranslation(double verticalTranslation)
verticalTranslation
- a value between 0.0 and 1.0 (where 0.0 would set the
corner to the top edge of the page and 1.0 would set
it at the bottom-edge of the page)setHorizontalTranslation(double)
,
getVerticalTranslation()
public PdfPopUpAnnot getPopup()
com.gnostice.pdfone.PdfProAnnot
public void setPopup(PdfPopUpAnnot popup, boolean overridePopUpProperties)
com.gnostice.pdfone.PdfProAnnot
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 boolean isFixedPrint()
setFixedPrint(boolean)
public void setFixedPrint(boolean isFixedPrint)
isFixedPrint
- true if it needs to be; false if otherwise.isFixedPrint()
,
setHorizontalTranslation(double)
,
setVerticalTranslation(double)
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 |