PoDoFo 0.9.6
PoDoFo::PdfSignatureField Class Reference

#include <PdfSignatureField.h>

Public Member Functions

 PdfSignatureField (PdfPage *pPage, const PdfRect &rRect, PdfDocument *pDoc)
 PdfSignatureField (PdfAnnotation *pWidget, PdfAcroForm *pParent, PdfDocument *pDoc, bool bInit=true)
 PdfSignatureField (PdfAnnotation *pWidget)
void SetAppearanceStream (PdfXObject *pObject, EPdfAnnotationAppearance eAppearance=ePdfAnnotationAppearance_Normal, const PdfName &state="")
void SetSignature (const PdfData &signatureData)
void SetSignatureReason (const PdfString &rsText)
void SetSignatureLocation (const PdfString &rsText)
void SetSignatureCreator (const PdfName &creator)
void SetSignatureDate (const PdfDate &sigDate)
void AddCertificationReference (PdfObject *pDocumentCatalog, EPdfCertPermission perm=ePdfCertPermission_NoPerms)
PdfObjectGetSignatureObject (void) const
void EnsureSignatureObject (void)

Detailed Description

Signature field

Constructor & Destructor Documentation

◆ PdfSignatureField() [1/3]

PoDoFo::PdfSignatureField::PdfSignatureField ( PdfPage * pPage,
const PdfRect & rRect,
PdfDocument * pDoc )

Create a new PdfSignatureField

◆ PdfSignatureField() [2/3]

PoDoFo::PdfSignatureField::PdfSignatureField ( PdfAnnotation * pWidget,
PdfAcroForm * pParent,
PdfDocument * pDoc,
bool bInit = true )

Create a new PdfSignatureField

Parameters
bInitcreates a signature field with/without a /V key

◆ PdfSignatureField() [3/3]

PoDoFo::PdfSignatureField::PdfSignatureField ( PdfAnnotation * pWidget)

Creates a PdfSignatureField from an existing PdfAnnotation, which should be an annotation with a field type Sig.

Parameters
pWidgetthe annotation to create from

Member Function Documentation

◆ AddCertificationReference()

void PoDoFo::PdfSignatureField::AddCertificationReference ( PdfObject * pDocumentCatalog,
EPdfCertPermission perm = ePdfCertPermission_NoPerms )

Add certification dictionaries and references to document catalog.

Parameters
pDocumentCatalogthe catalog of current document
permdocument modification permission

◆ EnsureSignatureObject()

void PoDoFo::PdfSignatureField::EnsureSignatureObject ( void )

Ensures that the signature field has set a signature object. The function does nothing, if the signature object is already set. This is useful for cases when the signature field had been created from an existing annotation, which didn't have it set.

◆ GetSignatureObject()

PdfObject * PoDoFo::PdfSignatureField::GetSignatureObject ( void ) const

Returns signature object for this signature field. It can be NULL, when the signature field was created from an existing annotation and it didn't have set it.

Returns
associated signature object, or NULL

◆ SetAppearanceStream()

void PoDoFo::PdfSignatureField::SetAppearanceStream ( PdfXObject * pObject,
EPdfAnnotationAppearance eAppearance = ePdfAnnotationAppearance_Normal,
const PdfName & state = "" )

Set an appearance stream for this signature field to specify its visual appearance

Parameters
pObjectan XObject
eAppearancean appearance type to set
statethe state for which set it the pObject; states depend on the annotation type

◆ SetSignature()

void PoDoFo::PdfSignatureField::SetSignature ( const PdfData & signatureData)

Create space for signature

Parameters
signatureDataString used to locate reserved space for signature. This string will be replaiced with signature.

Structure of the PDF file - before signing: <</ByteRange[ 0 1234567890 1234567890 1234567890]/Contents<signatureData> Have to be replaiced with the following structure: <</ByteRange[ 0 count pos count]/Contents<real signature ...0-padding>

◆ SetSignatureCreator()

void PoDoFo::PdfSignatureField::SetSignatureCreator ( const PdfName & creator)

Set the creator of the signature

Parameters
creatorthe creator of the signature

◆ SetSignatureDate()

void PoDoFo::PdfSignatureField::SetSignatureDate ( const PdfDate & sigDate)

Date of signature

◆ SetSignatureLocation()

void PoDoFo::PdfSignatureField::SetSignatureLocation ( const PdfString & rsText)

Set location of the signature

Parameters
rsTextthe location of signature

◆ SetSignatureReason()

void PoDoFo::PdfSignatureField::SetSignatureReason ( const PdfString & rsText)

Set reason of the signature

Parameters
rsTextthe reason of signature