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
FieldsModifier and TypeFieldDescriptionprotected org.apache.pdfbox.pdmodel.PDDocumentThe PDF documentprotected SignatureImageParametersVisual signature parametersprotected org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptionsContains options of the visual signature -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor instantiating object with null values -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddColorSpace(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 voidcheckColorSpace(org.apache.pdfbox.pdmodel.PDDocument pdDocument) Method to check if the target image's color space is present in the document's catalogprotected abstract DSSFontMetricsGets the correspondingeu.europa.esig.dss.pdf.visible.DSSFontMetricsprotected abstract StringReturns color space name for the provided imagevoidinit(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, waitMethods 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:PdfBoxSignatureDrawerInitializes the drawer- Specified by:
initin interfacePdfBoxSignatureDrawer- Parameters:
parameters-SignatureImageParametersdocument-PDDocumentsignatureOptions-SignatureOptions- Throws:
IOException- if an exception occurs
-
buildSignatureFieldBox
Builds a signature field dimension and position object- Specified by:
buildSignatureFieldBoxin 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-PDDocumentto check color profiles in- Throws:
IOException- in case of image reading error
-
getExpectedColorSpaceName
Returns color space name for the provided image- Returns:
Stringcolor 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-PDDocumentCatalogfrom a PDF document to add a new color space intocolorSpaceName-Stringa color space name to add
-