Class VisibleSignatureImage
java.lang.Object
se.idsec.signservice.security.sign.pdf.document.VisibleSignatureImage
Data object holding the parameters necessary to provide a signature image to a PDF document.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a date formatter given the settings of the beanorg.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptionsgetVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime) Generates PDFBox signature options that includes the visible signature.org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptionsgetVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime, int signatureSize) Generates PDFBox signature options that includes the visible signature.voidsetDateFormat(String dateFormat) Assigns the date format to use.voidsetTimeZoneId(String timeZoneId) Assigns the time zone ID.
-
Field Details
-
DEFAULT_DATE_FORMAT
Default date format.- See Also:
-
DEFAULT_TIMEZONE
-
FIRST_PAGE
public static final int FIRST_PAGEConstant representing "first page" (1).- See Also:
-
LAST_PAGE
public static final int LAST_PAGEContants representing "last page" (0).- See Also:
-
-
Constructor Details
-
VisibleSignatureImage
public VisibleSignatureImage()
-
-
Method Details
-
getVisibleSignatureOptions
public org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions getVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime) throws IOException Generates PDFBox signature options that includes the visible signature.Invokes
getVisibleSignatureOptions(PDDocument, Date, int)withsignatureSizeset to 0.- Parameters:
doc- the PDF document where the visible signature will be addedsignTime- the time when this signature is claimed to be created- Returns:
- a signature options object with visible signature
- Throws:
IOException- for errors creating the signature options
-
setDateFormat
Assigns the date format to use.- Parameters:
dateFormat- the date format- Throws:
IllegalArgumentException- for invalid input
-
setTimeZoneId
Assigns the time zone ID.- Parameters:
timeZoneId- the time zone ID, for example "Europe/Stockholm"- Throws:
IllegalArgumentException- for invalid input
-
getVisibleSignatureOptions
public org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions getVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime, int signatureSize) throws IOException Generates PDFBox signature options that includes the visible signature.- Parameters:
doc- the PDF document where the visible signature will be addedsignTime- the time when this signature is claimed to be createdsignatureSize- the preferred size of the signature data content (0 will use default size)- Returns:
- a signature options object with visible signature
- Throws:
IOException- for errors creating the signature options
-
createDateFormatter
Creates a date formatter given the settings of the bean- Returns:
- a
SimpleDateFormat
-