Class AbstractPdfBoxSignatureDrawer
java.lang.Object
eu.europa.esig.dss.pdf.pdfbox.visible.AbstractPdfBoxSignatureDrawer
- All Implemented Interfaces:
PdfBoxSignatureDrawer
,SignatureDrawer
,SignatureFieldBoxBuilder
- Direct Known Subclasses:
DefaultPdfBoxVisibleSignatureDrawer
,NativePdfBoxVisibleSignatureDrawer
public abstract class AbstractPdfBoxSignatureDrawer
extends Object
implements PdfBoxSignatureDrawer, SignatureFieldBoxBuilder
The abstract implementation of PDFBox signature drawer
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.pdfbox.pdmodel.PDDocument
The PDF documentprotected SignatureImageParameters
Visual signature parametersprotected org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions
Contains options of the visual signature -
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor instantiating object with null values -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addColorSpace
(org.apache.pdfbox.pdmodel.PDDocumentCatalog catalog, String colorSpaceName) This method is used to add a new required color space to a documentBuilds a signature field dimension and position objectprotected void
checkColorSpace
(org.apache.pdfbox.pdmodel.PDDocument pdDocument) Method to check if the target image's color space is present in the document's catalogprotected abstract DSSFontMetrics
Gets the correspondingeu.europa.esig.dss.pdf.visible.DSSFontMetrics
protected abstract String
Returns color space name for the provided imagevoid
init
(SignatureImageParameters parameters, org.apache.pdfbox.pdmodel.PDDocument document, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions signatureOptions) Initializes the drawerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.pdf.visible.SignatureDrawer
draw
-
Field Details
-
parameters
Visual signature parameters -
document
protected org.apache.pdfbox.pdmodel.PDDocument documentThe PDF document -
signatureOptions
protected org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions signatureOptionsContains options of the visual signature
-
-
Constructor Details
-
AbstractPdfBoxSignatureDrawer
protected AbstractPdfBoxSignatureDrawer()Default constructor instantiating object with null values
-
-
Method Details
-
init
public void init(SignatureImageParameters parameters, org.apache.pdfbox.pdmodel.PDDocument document, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions signatureOptions) throws IOException Description copied from interface:PdfBoxSignatureDrawer
Initializes the drawer- Specified by:
init
in interfacePdfBoxSignatureDrawer
- Parameters:
parameters
-SignatureImageParameters
document
-PDDocument
signatureOptions
-SignatureOptions
- Throws:
IOException
- if an exception occurs
-
buildSignatureFieldBox
Builds a signature field dimension and position object- Specified by:
buildSignatureFieldBox
in interfaceSignatureFieldBoxBuilder
- Returns:
SignatureFieldDimensionAndPosition
-
getDSSFontMetrics
Gets the correspondingeu.europa.esig.dss.pdf.visible.DSSFontMetrics
- Returns:
DSSFontMetrics
-
checkColorSpace
Method to check if the target image's color space is present in the document's catalog- Parameters:
pdDocument
-PDDocument
to check color profiles in- Throws:
IOException
- in case of image reading error
-
getExpectedColorSpaceName
Returns color space name for the provided image- Returns:
String
color space name- Throws:
IOException
- in case of image reading error
-
addColorSpace
protected void addColorSpace(org.apache.pdfbox.pdmodel.PDDocumentCatalog catalog, String colorSpaceName) This method is used to add a new required color space to a document- Parameters:
catalog
-PDDocumentCatalog
from a PDF document to add a new color space intocolorSpaceName
-String
a color space name to add
-