public class Appearance extends NativeObject
A signature may have a visual appearance on a page of the document. The visual appearance is optional and has no effect on the validity of the signature. Because of this and because a visual appearance may cover important content of the page, it is recommended to create invisible signatures by default.
Typically, a visual appearance is created for forms with a dedicated area reserved for the appearance. Other transaction documents, e.g. invoices, correspondence, or bank statements, are usually signed without a visual appearance.
The appearance can be positioned on a page using getPageNumber()
, getTop()
, getRight()
,
getBottom()
, and getLeft()
.
It is recommended to set either getTop()
or getBottom()
and getRight()
or getLeft()
.
If all are null
, the default is to position the appearance in the lower right corner with 12 pt
(1/6 inch
or 4.2 mm
) distance to the bottom and right edge of the page,
i.e. Bottom = 12
and Right = 12
.
Modifier and Type | Method | Description |
---|---|---|
static Appearance |
createFieldBoundingBox(Size size) |
Create the bounding box for an unsigned signature field
|
Length |
getBottom() |
Distance to bottom of page (Getter)
|
Length |
getLeft() |
Distance to left of page (Getter)
|
java.lang.Integer |
getPageNumber() |
The number of the page where the appearance is positioned (Getter)
|
Length |
getRight() |
Distance to right of page (Getter)
|
Length |
getTop() |
Distance to top of page (Getter)
|
void |
setBottom(Length value) |
Distance to bottom of page (Setter)
|
void |
setLeft(Length value) |
Distance to left of page (Setter)
|
void |
setPageNumber(java.lang.Integer value) |
The number of the page where the appearance is positioned (Setter)
|
void |
setRight(Length value) |
Distance to right of page (Setter)
|
void |
setTop(Length value) |
Distance to top of page (Setter)
|
equals, hashCode
public static Appearance createFieldBoundingBox(Size size)
size
- The size of the rectanglejava.lang.IllegalArgumentException
- if size
is null
public java.lang.Integer getPageNumber()
Page number must be in the range from 1
to pdftools.pdf.Document.getPageCount
.
If null
, the appearance is positioned on the last page.
Default: null
public void setPageNumber(java.lang.Integer value)
Page number must be in the range from 1
to pdftools.pdf.Document.getPageCount
.
If null
, the appearance is positioned on the last page.
Default: null
public Length getTop()
This property specifies the distance between appearance's top edge and the top of the page.
If null
, the distance to the top is unspecified.
Default: null
public void setTop(Length value)
This property specifies the distance between appearance's top edge and the top of the page.
If null
, the distance to the top is unspecified.
Default: null
java.lang.IllegalArgumentException
- If the given value is negativepublic Length getRight()
This property specifies the distance between appearance's right edge and the right of the page.
If null
, the distance to the right is unspecified.
Default: null
public void setRight(Length value)
This property specifies the distance between appearance's right edge and the right of the page.
If null
, the distance to the right is unspecified.
Default: null
java.lang.IllegalArgumentException
- If the given value is negativepublic Length getBottom()
This property specifies the distance between appearance's bottom edge and the bottom of the page.
If null
, the distance to the bottom is unspecified.
Default: null
public void setBottom(Length value)
This property specifies the distance between appearance's bottom edge and the bottom of the page.
If null
, the distance to the bottom is unspecified.
Default: null
java.lang.IllegalArgumentException
- If the given value is negativepublic Length getLeft()
This property specifies the distance between appearance's left edge and the left of the page.
If null
, the distance to the left is unspecified.
Default: null
public void setLeft(Length value)
This property specifies the distance between appearance's left edge and the left of the page.
If null
, the distance to the left is unspecified.
Default: null
java.lang.IllegalArgumentException
- If the given value is negative