An interface for SignDoc documents. More...
#include <SignDocSDK-cpp.h>
Public Types | |
enum | DocumentType { dt_unknown, dt_pdf, dt_tiff, dt_other, dt_fdf } |
Supported document types. More... | |
enum | SaveFlags { sf_incremental = 0x01, sf_remove_unused = 0x02, sf_linearized = 0x04, sf_pdf_1_4 = 0x08, sf_pdfa_buttons = 0x10 } |
Flags modifying the behavior of saveToFile() and saveToStream(). More... | |
enum | CopyToStreamFlags { ctsf_unsaved = 0x01 } |
Flags modifying the behavior of copyToStream(). More... | |
enum | SetFieldFlags { sff_font_fail = 0x01, sff_font_warn = 0x02, sff_font_ignore = 0x04, sff_move = 0x08, sff_keep_ap = 0x10, sff_update_ap = 0x20, sff_fit_height_only = 0x40, sff_force_border_width = 0x80, sff_dont_break_lines = 0x100 } |
Flags modifying the behavior of setField(), addField(), and applyFdf(). More... | |
enum | FlattenFieldsFlags { fff_include_signature_unsigned = 0x01, fff_include_signature_signed = 0x02, fff_include_hidden = 0x04, fff_keep_structure = 0x08 } |
Flags modifying the behavior of flattenFields(). More... | |
enum | FindTextFlags { ftf_ignore_hspace = 0x0001, ftf_ignore_hyphenation = 0x0002, ftf_ignore_sequence = 0x0004 } |
Flags modifying the behavior of findText(). More... | |
enum | ExportFlags { e_top = 0x01 } |
Flags modifying the behavior of exportFields() and exportProperties(). More... | |
enum | ImportFlags { i_atomic = 0x01 } |
Flags modifying the behavior of importProperties(). More... | |
enum | ImportImageFlags { ii_keep_aspect_ratio = 0x01, ii_brightest_transparent = 0x02 } |
Flags modifying the behavior of addImageFromBlob(), addImageFromFile(), importPageFromImageBlob(), and importPageFromImageFile(). More... | |
enum | KeepOrRemove { kor_keep, kor_remove } |
Tell removePages() to keep or to remove the specified pages. More... | |
enum | ReturnCode { rc_ok, rc_invalid_argument, rc_field_not_found, rc_invalid_profile, rc_invalid_image, rc_type_mismatch, rc_font_not_found, rc_no_datablock, rc_not_supported, rc_io_error, rc_not_verified, rc_property_not_found, rc_page_not_found, rc_wrong_collection, rc_field_exists, rc_license_error, rc_unexpected_error, rc_cancelled, rc_no_biometric_data, rc_parameter_not_set, rc_field_not_signed, rc_invalid_signature, rc_annotation_not_found, rc_attachment_not_found, rc_attachment_exists, rc_no_certificate, rc_ambiguous_certificate, rc_not_allowed } |
Return codes. More... | |
enum | CheckAttachmentResult { car_match, car_no_checksum, car_mismatch } |
Result of checkAttachment(). More... | |
enum | HAlignment { ha_left, ha_center, ha_right } |
Horizontal alignment for addTextRect(). More... | |
enum | VAlignment { va_top, va_center, va_bottom } |
Vertical alignment for addTextRect(). More... | |
enum | Flags { f_relax_byte_range = 0x01, f_ambiguous_button_value_empty = 0x02 } |
Flags for setFlags(). More... | |
enum | ShootInFootFlags { siff_allow_breaking_signatures = 0x01, siff_allow_breaking_permissions = 0x02, siff_allow_invalid_certificate = 0x04, siff_allow_non_standard_external_fonts = 0x08, siff_assume_ap_not_shared = 0x10, siff_assume_ap_shared = 0x20 } |
Flags for setShootInFoot(). More... | |
Public Member Functions | |
SignDocDocument () | |
Constructor. | |
~SignDocDocument () | |
Destructor. | |
DocumentType | getType () const |
Get the type of the document. | |
int | getPageCount () const |
Get the number of pages. | |
ReturnCode | createSignatureParameters (Encoding aEncoding, const std::string &aFieldName, const std::string &aProfile, std::auto_ptr< SignDocSignatureParameters > &aOutput) |
Create a SignDocSignatureParameters object for signing a signature field. | |
ReturnCode | createSignatureParameters (const wchar_t *aFieldName, const wchar_t *aProfile, std::auto_ptr< SignDocSignatureParameters > &aOutput) |
Create a SignDocSignatureParameters object for signing a signature field. | |
ReturnCode | getProfiles (Encoding aEncoding, const std::string &aFieldName, std::vector< std::string > &aOutput) |
Get a list of profiles for a signature field. | |
ReturnCode | addSignature (SignDocSignatureParameters *aSignatureParameters, const SignDocVerificationParameters *aVerificationParameters) |
Sign the document. | |
ReturnCode | getLastTimestamp (std::string &aTime) |
Get the timestamp used by the last successful call of addSignature(). | |
ReturnCode | getPathname (Encoding aEncoding, std::string &aPath) |
Get the current pathname of the document. | |
int | getAvailableMethods () |
Get a bitset indicating which signing methods are available for this document. | |
ReturnCode | verifySignature (Encoding aEncoding, const std::string &aFieldName, std::auto_ptr< SignDocVerificationResult > &aOutput) |
Verify a signature of the document. | |
ReturnCode | verifySignature (const wchar_t *aFieldName, std::auto_ptr< SignDocVerificationResult > &aOutput) |
Verify a signature of the document. | |
ReturnCode | clearSignature (Encoding aEncoding, const std::string &aFieldName) |
Remove a signature of the document. | |
ReturnCode | clearAllSignatures () |
Remove all signature of the document. | |
ReturnCode | saveToStream (OutputStream &aStream, int aFlags) |
Save the document to a stream. | |
ReturnCode | saveToFile (Encoding aEncoding, const char *aPath, int aFlags) |
Save the document to a file. | |
ReturnCode | saveToFile (const wchar_t *aPath, int aFlags) |
Save the document to a file. | |
ReturnCode | copyToStream (OutputStream &aStream, unsigned aFlags) |
Copy the document's current status or backing file or backing blob to a stream. | |
ReturnCode | copyAsSignedToStream (Encoding aEncoding, const std::string &aFieldName, OutputStream &aStream) |
Copy the document to a stream for viewing the document "as signed". | |
ReturnCode | getSaveToStreamFlags (int &aOutput) |
Get all flags currently valid for saveToStream(). | |
ReturnCode | getSaveToFileFlags (int &aOutput) |
Get all flags currently valid for saveToFile(). | |
ReturnCode | getRequiredSaveToFileFlags (int &aOutput) |
Get all flags currently required for saveToFile(). | |
ReturnCode | getFields (int aTypes, std::vector< SignDocField > &aOutput) |
Get all interactive fields of the specified types. | |
ReturnCode | getFieldsOfPage (int aPage, int aTypes, std::vector< SignDocField > &aOutput) |
Get all interactive fields of the specified page, in tab order. | |
ReturnCode | getField (Encoding aEncoding, const std::string &aName, SignDocField &aOutput) |
Get an interactive field by name. | |
ReturnCode | setField (SignDocField &aField, unsigned aFlags) |
Change a field. | |
ReturnCode | addField (SignDocField &aField, unsigned aFlags) |
Add a field. | |
ReturnCode | removeField (Encoding aEncoding, const std::string &aName) |
Remove a field. | |
ReturnCode | flattenField (Encoding aEncoding, const std::string &aName, int aWidget) |
Flatten a field. | |
ReturnCode | flattenFields (int aFirstPage, int aLastPage, unsigned aFlags) |
Flatten all fields of the document or of a range of pages. | |
ReturnCode | exportFields (OutputStream &aStream, int aFlags) |
Export all fields as XML. | |
ReturnCode | applyFdf (Encoding aEncoding, const char *aPath, unsigned aFlags) |
Apply an FDF document to a PDF document. | |
ReturnCode | applyFdf (const wchar_t *aPath, unsigned aFlags) |
Apply an FDF document to a PDF document. | |
ReturnCode | getTextFieldAttributes (SignDocTextFieldAttributes &aOutput) |
Get the document's default text field attributes. | |
ReturnCode | setTextFieldAttributes (SignDocTextFieldAttributes &aData) |
Set the document's default text field attributes. | |
ReturnCode | getProperties (const std::string &aCollection, std::vector< SignDocProperty > &aOutput) |
Get the names and types of all SignDoc properties of a certain collection of properties of the document. | |
ReturnCode | getIntegerProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, long &aValue) |
Get the value of a SignDoc property (integer). | |
ReturnCode | getStringProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, std::string &aValue) |
Get the value of a SignDoc property (string). | |
ReturnCode | getBooleanProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, bool &aValue) |
Get the value of a SignDoc property (boolean). | |
ReturnCode | setIntegerProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, long aValue) |
Set the value of a SignDoc property (integer). | |
ReturnCode | setStringProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, const std::string &aValue) |
Set the value of a SignDoc property (string). | |
ReturnCode | setBooleanProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName, bool aValue) |
Set the value of a SignDoc property (boolean). | |
ReturnCode | removeProperty (Encoding aEncoding, const std::string &aCollection, const std::string &aName) |
Remove a SignDoc property. | |
ReturnCode | exportProperties (const std::string &aCollection, OutputStream &aStream, int aFlags) |
Export properties as XML. | |
ReturnCode | importProperties (const std::string &aCollection, InputStream &aStream, int aFlags) |
Import properties from XML. | |
ReturnCode | getDataBlock (std::vector< unsigned char > &aOutput) |
Get the SignDoc data block of the document. | |
ReturnCode | setDataBlock (const unsigned char *aData, size_t aSize) |
Replace the SignDoc data block of the document. | |
ReturnCode | getResolution (int aPage, double &aResX, double &aResY) |
Get the resolution of a page. | |
ReturnCode | getConversionFactors (int aPage, double &aFactorX, double &aFactorY) |
Get the conversion factors for a page. | |
ReturnCode | getPageSize (int aPage, double &aWidth, double &aHeight) |
Get the size of a page. | |
ReturnCode | getBitsPerPixel (int aPage, int &aBPP) |
Get the number of bits per pixel (TIFF only). | |
ReturnCode | computeZoom (double &aOutput, const SignDocRenderParameters &aParams) |
Compute the zoom factor used for rendering. | |
ReturnCode | convCanvasPointToPagePoint (Point &aPoint, const SignDocRenderParameters &aParams) |
Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the current page. | |
ReturnCode | convPagePointToCanvasPoint (Point &aPoint, const SignDocRenderParameters &aParams) |
Convert a point expressed in document coordinate system of the current page to a point expressed in canvas (image) coordinates. | |
ReturnCode | renderPageAsImage (std::vector< unsigned char > &aImage, SignDocRenderOutput &aOutput, const SignDocRenderParameters &aRenderParameters, const SignDocVerificationParameters *aVerificationParameters, const Rect *aClipRect) |
Render the selected page (or pages) as image. | |
ReturnCode | getRenderedSize (SignDocRenderOutput &aOutput, const SignDocRenderParameters &aRenderParameters) |
Get the size of the rendered page in pixels (without actually rendering it). | |
SignDocAnnotation * | createLineAnnotation (const Point &aStart, const Point &aEnd) |
Create a line annotation. | |
SignDocAnnotation * | createLineAnnotation (double aStartX, double aStartY, double aEndX, double aEndY) |
Create a line annotation. | |
SignDocAnnotation * | createScribbleAnnotation () |
Create a scribble annotation. | |
SignDocAnnotation * | createFreeTextAnnotation (const Point &aLowerLeft, const Point &aUpperRight) |
Create a text annotation. | |
SignDocAnnotation * | createFreeTextAnnotation (double aX0, double aY0, double aX1, double aY1) |
Create a text annotation. | |
ReturnCode | addAnnotation (int aPage, const SignDocAnnotation *aAnnot) |
Add an annotation to a page. | |
ReturnCode | getAnnotations (Encoding aEncoding, int aPage, std::vector< std::string > &aOutput) |
Get a list of all named annotations of a page. | |
ReturnCode | getAnnotation (Encoding aEncoding, int aPage, const std::string &aName, std::auto_ptr< SignDocAnnotation > &aOutput) |
Get a named annotation of a page. | |
ReturnCode | removeAnnotation (Encoding aEncoding, int aPage, const std::string &aName) |
Remove an annotation identified by name. | |
ReturnCode | addText (Encoding aEncoding, const std::string &aText, int aPage, double aX, double aY, const std::string &aFontName, double aFontSize, const SignDocColor &aTextColor, double aOpacity, int aFlags) |
Add text to a page. | |
ReturnCode | addTextRect (Encoding aEncoding, const std::string &aText, int aPage, double aX0, double aY0, double aX1, double aY1, const std::string &aFontName, double aFontSize, double aLineSkip, const SignDocColor &aTextColor, double aOpacity, HAlignment aHAlignment, VAlignment aVAlignment, int aFlags) |
Add text in a rectangle of a page (with line breaking). | |
ReturnCode | addWatermark (const SignDocWatermark &aInput) |
Add a watermark. | |
ReturnCode | findText (Encoding aEncoding, int aFirstPage, int aLastPage, const std::string &aText, int aFlags, std::vector< SignDocFindTextPosition > &aOutput) |
Find text. | |
ReturnCode | addAttachmentBlob (Encoding aEncoding, const std::string &aName, const std::string &aDescription, const std::string &aType, const std::string &aModificationTime, const void *aPtr, size_t aSize, int aFlags) |
Add an attachment to the document. | |
ReturnCode | addAttachmentFile (Encoding aEncoding1, const std::string &aName, const std::string &aDescription, const std::string &aType, Encoding aEncoding2, const std::string &aPath, int aFlags) |
Add an attachment (read from a file) to the document. | |
ReturnCode | removeAttachment (Encoding aEncoding, const std::string &aName) |
Remove an attachment from the document. | |
ReturnCode | changeAttachmentDescription (Encoding aEncoding, const std::string &aName, const std::string &aDescription) |
Change the description of an attachment of the document. | |
ReturnCode | getAttachments (Encoding aEncoding, std::vector< std::string > &aOutput) |
Get a list of all attachments of the document. | |
ReturnCode | getAttachment (Encoding aEncoding, const std::string &aName, SignDocAttachment &aOutput) |
Get information about an attachment. | |
ReturnCode | checkAttachment (Encoding aEncoding, const std::string &aName, CheckAttachmentResult &aOutput) |
Check the checksum of an attachment. | |
ReturnCode | getAttachmentBlob (Encoding aEncoding, const std::string &aName, std::vector< unsigned char > &aOutput) |
Get an attachment as blob. | |
ReturnCode | getAttachmentStream (Encoding aEncoding, const std::string &aName, std::auto_ptr< InputStream > &aOutput) |
Get an InputStream for an attachment. | |
ReturnCode | addPage (int aTargetPage, double aWidth, double aHeight) |
Add an empty page to the document. | |
ReturnCode | importPages (int aTargetPage, SignDocDocument *aSource, int aSourcePage, int aPageCount, int aFlags) |
Import pages from another document. | |
ReturnCode | importPageFromImageBlob (int aTargetPage, const unsigned char *aPtr, size_t aSize, double aZoom, double aWidth, double aHeight, int aFlags) |
Import a page from a blob containing an image. | |
ReturnCode | importPageFromImageFile (int aTargetPage, Encoding aEncoding, const std::string &aPath, double aZoom, double aWidth, double aHeight, int aFlags) |
Import a page from a file containing an image. | |
ReturnCode | addImageFromBlob (int aTargetPage, const unsigned char *aPtr, size_t aSize, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags) |
Add an image (from a blob) to a page. | |
ReturnCode | addImageFromFile (int aTargetPage, Encoding aEncoding, const std::string &aPath, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags) |
Add an image (from a file) to a page. | |
ReturnCode | removePages (const int *aPagesPtr, int aPagesCount, KeepOrRemove aMode) |
Remove pages from the document. | |
ReturnCode | setCompatibility (int aMajor, int aMinor) |
Request to not make changes to the document which are incompatible with an older version of this class. | |
ReturnCode | isModified (bool &aModified) const |
Check if the document has unsaved changes. | |
ReturnCode | setFlags (unsigned aFlags) |
Set flags modifying the behavior of various functions. | |
unsigned | getFlags () const |
Get the flags set by setFlags(). | |
ReturnCode | setCompressionLevel (int aLevel) |
Set the FlateDecode compression level. | |
ReturnCode | removePermissions (unsigned aFlags) |
Remove signatures that grant permissions. | |
ReturnCode | removePDFA (unsigned aFlags) |
Remove PDF/A conformance. | |
ReturnCode | setShootInFoot (unsigned aFlags) |
Disable safety checks. | |
unsigned | getShootInFoot () const |
Get the flags set by setShootInFoot(). | |
const char * | getErrorMessage (Encoding aEncoding) const |
Get an error message for the last function call. | |
const wchar_t * | getErrorMessageW () const |
Get an error message for the last function call. | |
SPPDF_Document * | getSPPDFDocument (bool aDestroy) |
Get the underlying SPPDF_Document object. | |
SignDocDocument (SIGNDOC_Document *aP) | |
Internal function. | |
SIGNDOC_Document * | getImpl () |
Internal function. | |
const SIGNDOC_Document * | getImpl () const |
Internal function. | |
void | setImpl (SIGNDOC_Document *aP) |
Internal function. |
An interface for SignDoc documents.
An object of this class represents one document.
Use SignDocDocumentLoader::loadFromMemory(), SignDocDocumentLoader::loadFromFile(), or SignDocDocumentLoader::createPDF() to create objects.
If the document is loaded from a file, the file may remain in use until this object is destroyed or the document is saved to a different file with saveToFile(). Please do not change the file while there is a SignDocDocument object for it.
Use getErrorMessage() to get more information after a function call failed.
Constructors and destructors:
Getting basic information about the document:
Saving the document:
Working with interactive fields:
Signing signature fields:
Verifying and removing signatures:
Working with properties:
Working with pages:
Working with annotations:
Adding text to a page and finding text on pages:
Adding images to a page:
Working with attachments:
Other functions:
Result of checkAttachment().
Flags modifying the behavior of copyToStream().
ctsf_unsaved |
Include unsaved changes. See copyToStream() for details. |
Flags modifying the behavior of exportFields() and exportProperties().
Flags modifying the behavior of findText().
Flags for setFlags().
f_relax_byte_range |
Relax checking of ByteRange. If this flag is set, ByteRange may have any values allowed by ISO 32000-1:2008. If this flag is not set, verifySignature() behaves like Adobe Reader: ByteRange must have two ranges, sorted by offset, and covering the complete document. (Covering the complete document is required for PAdES, the other two criterions are not.) This flag is used for PDF documents only, it is ignored for TIFF documents.
|
f_ambiguous_button_value_empty |
Make exportFields(), getField(), getFields(), and getFieldsOfPage() return an empty button value if there are multiple non-Off values for a check box field. An empty button value will make setField() fail. Set this flag if you want to detect check box fields with ambiguous button values or if you want to keep the behavior of SignDoc SDK 4.0 and earlier. If this flag is not set, the first non-Off value of a check box field will be used as button value. The ordering used for determining the first non-Off value is unspecified and may change with different versions of SignDoc SDK. This flag is used for PDF documents only, it is ignored for TIFF documents. |
Flags modifying the behavior of flattenFields().
Horizontal alignment for addTextRect().
Flags modifying the behavior of importProperties().
Flags modifying the behavior of addImageFromBlob(), addImageFromFile(), importPageFromImageBlob(), and importPageFromImageFile().
ii_keep_aspect_ratio |
Keep aspect ratio of image, center image on white background. |
ii_brightest_transparent |
Make the brightest color transparent. This flag may be specified for addImageFromBlob() and addImageFromFile() only. importPageFromImageBlob() and importPageFromImageFile() always make the image opaque. The rest of this description applies to addImageFromBlob() and addImageFromFile() only. If the image has an alpha channel (or if its palette contains a transparent color), this flag will be ignored and the image's transparency will be used. Transparency is not supported for JPEG images and JPEG-compressed TIFF images. If this flag is not set, the image will be opaque unless the image has an alpha channel or transparent colors in its palette. If this flag is set (and the image doesn't have an alpha channel and doesn't have transparent colors in its palette), white will be made transparent for truecolor images and the brightest color in the palette will be made transparent for indexed images (including grayscale images). |
Tell removePages() to keep or to remove the specified pages.
Return codes.
Do not forget to update de/softpro/doc/SignDocException.java!
rc_ok |
No error. |
rc_invalid_argument |
Invalid argument. |
rc_field_not_found |
Field not found (or not a signature field) |
rc_invalid_profile |
Profile unknown or not applicable. |
rc_invalid_image |
Invalid image (e.g., unsupported format) |
rc_type_mismatch |
Field type or property type mismatch. |
rc_font_not_found |
The requested font could not be found or does not contain all required characters, see also setShootInFoot() |
rc_no_datablock |
No datablock found (obsolete) |
rc_not_supported |
Operation not supported. |
rc_io_error |
I/O error. |
rc_not_verified |
(used by SignDocVerificationResult) |
rc_property_not_found |
Property not found. |
rc_page_not_found |
Page not found (invalid page number) |
rc_wrong_collection |
Property accessed via wrong collection. |
rc_field_exists |
Field already exists. |
rc_license_error |
License initialization failed or license check failed. |
rc_unexpected_error |
Unexpected error. |
rc_cancelled |
Certificate dialog cancelled by user. |
rc_no_biometric_data |
(used by SignDocVerificationResult) |
rc_parameter_not_set |
(Java only) |
rc_field_not_signed |
Field not signed, for copyAsSignedToStream() |
rc_invalid_signature |
Signature is not valid, for copyAsSignedToStream() |
rc_annotation_not_found |
Annotation not found, for getAnnotation() |
rc_attachment_not_found |
Attachment not found. |
rc_attachment_exists |
Attachment already exists. |
rc_no_certificate |
No (matching) certificate found and SignDocSignatureParameters::csf_create_self_signed is not specified. |
rc_ambiguous_certificate |
More than one matching certificate found and SignDocSignatureParameters::csf_never_ask is specified. |
rc_not_allowed |
Operation not allowed due to document being signed or conforming to PDF/A or having logical structure, see setShootInFoot() and removePDFA() |
Flags modifying the behavior of saveToFile() and saveToStream().
sf_incremental |
Save incrementally (PDF). |
sf_remove_unused |
Remove unused objects (PDF). This flag is ignored, unused objects are always removed. |
sf_linearized |
Linearize the document (PDF). This flag cannot be used with sf_incremental.
|
sf_pdf_1_4 |
Do not use features introduced after PDF 1.4 for saving the document. This flag is assumed to be set for PDF 1.4 (and older) documents (PDF). |
sf_pdfa_buttons |
Fix appearance streams of check boxes and radio buttons for PDF/A documents. The appearance streams of a check box or radio button field added by addField() or modified by setField() or applyFdf() are not PDF/A-1-compliant. To make the appearance streams of check boxes and radio buttons PDF/A-1-compliant, save the document with this flag set. The document will be modified in memory and then saved. This flag is observed even if the document does not claim to be PDF/A-1-compliant.
|
Flags modifying the behavior of setField(), addField(), and applyFdf().
Exactly one of sff_font_fail, sff_font_warn, and sff_font_ignore must be specified, the other flags are optional.
sff_font_fail |
Fail if no suitable font is found. setField(), addField(), and applyFdf() won't modify/add the field and will report error rc_font_not_found if no font covering all required characters is found. |
sff_font_warn |
Warn if no suitable font is found. setField(), addField(), and applyFdf() will modify/add the field even if no font covering all required characters is found, but they will report error rc_font_not_found. The appearance of the field won't represent the contents in that case. |
sff_font_ignore |
Ignore font problems. setField(), addField(), and applyFdf() will modify/add the field even if no font covering all required characters is found, and they won't report the problem to the caller. The appearance of the field won't represent the contents in that case. |
sff_move |
Move or resize field. setField() does not update the coordinates of the field unless this flag is set as moving a field may require recomputing the appearance can have unexpected results (for instance, Adobe Acrobat and SignDoc SDK use different designs for check marks). If this flag is not set, setField() ignores the coordinates set with SignDocField::setLeft(), SignDocField::setBottom(), SignDocField::setRight(), and SignDocField::setTop(). addField() ignores this flag, it always uses the coordinates. applyFdf() ignores this flag, it never moves or resizes fields. |
sff_keep_ap |
Keep appearance streams. If this flag is set, setField() and applyFdf() won't touch the existing (or non-existing) appearance streams, addField() won't add any appearance streams. Recomputing the appearance can have unexpected results (for instance, Adobe Acrobat and SignDoc SDK use different designs for chedck marks), therefore you might want to set this flag if you make changes that shall not affect the appearance such as setting the SignDocField::f_ReadOnly flag. At most one of sff_keep_ap and sff_update_ap can be set.
|
sff_update_ap |
Update appearance streams. If this flag is set, setField() and applyFdf() will always recompute the appearance streams of the field. (addField() always computes the appearance stream unless sff_keep_ap is set). You might want to use this flag after changing the document's default text field attributes. At most one of sff_keep_ap and sff_update_ap can be set. If neither sff_keep_ap and sff_update_ap is set, setField() and applyFdf() try to update the appearance streams only if necessary; the exact behavior depends on the version of SignDoc SDK.
|
sff_fit_height_only |
Compute the default font size such that the field contents fit the height of the field. If the font size for a text field, list box field, or combo box field is zero (see SignDocTextFieldAttributes::setFontSize()), the default font size will be used. This flag controls how the default font size is computed. If this flag is set, the font size will be computed such that the field contents fit the height of the field. This is the behavior required by the PDF specification. If the field contents are too long, they will be truncated. If this flag is not set, the font size will be computed such that the field contents fit both the height and the width of the field. This is the behavior implemented in, for instance, Adobe Acrobat. This flag is assumed to be not set if line breaking is enabled. |
sff_force_border_width |
Use the border width specified by the field even if that will obliterate the field contents. If this flag is set, the behavior matches that of Adobe Acrobat. If this flag is not set, the border width will be reduced to 1/16 of the field height or field width (whichever is smaller) if the border width specified by the field wouldn't leave enough space for the field contents. |
sff_dont_break_lines |
Do not break lines in multiline text fields. You can use this flag to simulate the behavior of SignDoc SDK 4.0 and earlier. |
Flags for setShootInFoot().
siff_allow_breaking_signatures |
Allow operations to break existing signatures in signature fields. This flag is available for PDF documents only. |
siff_allow_breaking_permissions |
Allow operations to break signatures which grant permissions. This flag is available for PDF documents only. |
siff_allow_invalid_certificate |
Allow signing with a certificate that is not yet valid or no longer valid or which is not qualified for digital signatures. |
siff_allow_non_standard_external_fonts |
Allow non-standard usage of external (non-embedded) TrueType fonts. If this flag is not set, TrueType fonts must be embedded; when trying to use a TrueType font that is not embededded, error rc_font_not_found will be reported. If this flag is set, external TrueType fonts are allowed. However, the document will violate Table 117, section 9.7.4.2 and section 9.7.5.2 of ISO 32000-1:2008. |
siff_assume_ap_not_shared |
Assume that appearance dictionaries and appearance streams are not shared. If this flag is set and that assumption doesn't hold, changing one field may change the appearances of other fields. At most one of siff_assume_ap_not_shared and siff_assume_ap_shared can be set. If neither flag is set, setField() and addSignature() look for shared objects. This can be expensive in terms of time and memory. |
siff_assume_ap_shared |
Always assume that appearance dictionaries and appearance streams are shared. Setting this flag partially simulates the behavior of SignDoc SDK 3.x and older and causes a minor violation of section 12.7.3.3 of ISO 32000-1:2008 by setField(). At most one of siff_assume_ap_not_shared and siff_assume_ap_shared can be set. If neither flag is set, setField() and addSignature() look for shared objects. This can be expensive in terms of time and memory. |
Vertical alignment for addTextRect().
de::softpro::doc::SignDocDocument::SignDocDocument | ( | ) | [inline] |
Constructor.
Use SignDocDocumentLoader::loadFromMemory(), SignDocDocumentLoader::loadFromFile(), or SignDocDocumentLoader::createPDF() to create objects.
de::softpro::doc::SignDocDocument::~SignDocDocument | ( | ) | [inline] |
Destructor.
de::softpro::doc::SignDocDocument::SignDocDocument | ( | SIGNDOC_Document * | aP ) | [inline] |
Internal function.
ReturnCode de::softpro::doc::SignDocDocument::addAnnotation | ( | int | aPage, |
const SignDocAnnotation * | aAnnot | ||
) | [inline] |
Add an annotation to a page.
See SignDocAnnotation for details.
[in] | aPage | The page number (1 for the first page). |
[in] | aAnnot | Pointer to the new annotation. Ownership remains at the caller. |
ReturnCode de::softpro::doc::SignDocDocument::addAttachmentBlob | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
const std::string & | aDescription, | ||
const std::string & | aType, | ||
const std::string & | aModificationTime, | ||
const void * | aPtr, | ||
size_t | aSize, | ||
int | aFlags | ||
) | [inline] |
Add an attachment to the document.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName and aDescription. |
[in] | aName | The name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons. |
[in] | aDescription | The description of the attachment (can be empty). |
[in] | aType | The MIME type of the attachment (can be empty, seems to be ignored by Adobe Reader). |
[in] | aModificationTime | The time and date of the last modification of the file being attached to the document (can be empty). Must be in ISO 8601 extended calendar date format with optional timezone. |
[in] | aPtr | Pointer to the first octet of the attachment. |
[in] | aSize | The size (in octets) of the attachment. |
[in] | aFlags | Must be zero. |
ReturnCode de::softpro::doc::SignDocDocument::addAttachmentFile | ( | Encoding | aEncoding1, |
const std::string & | aName, | ||
const std::string & | aDescription, | ||
const std::string & | aType, | ||
Encoding | aEncoding2, | ||
const std::string & | aPath, | ||
int | aFlags | ||
) | [inline] |
Add an attachment (read from a file) to the document.
Attachments are supported for PDF documents only.
[in] | aEncoding1 | The encoding of aName and aDescription. |
[in] | aName | The name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons. |
[in] | aDescription | The description of the attachment (can be empty). |
[in] | aType | The MIME type of the attachment (can be empty, seems to be ignored by Adobe Reader). |
[in] | aEncoding2 | The encoding of aPath. |
[in] | aPath | The pathname of the file to be attached. |
[in] | aFlags | Must be zero. |
ReturnCode de::softpro::doc::SignDocDocument::addField | ( | SignDocField & | aField, |
unsigned | aFlags | ||
) | [inline] |
Add a field.
See the members of SignDocField for details.
This function can add check boxes, radio button groups, text fields, and signature fields to PDF documents.
When adding a radio button group or a check box field, a value must be set, see SignDocField::setValue() and SignDocField::setValueIndex().
The SignDocField::f_NoToggleToOff flag should be set for all radio button groups. Adobe products seem to ignore this flag being not set.
When adding a text field, the justification must be set with SignDocField::setJustification().
Currently, you don't have control over the appearance of the field being inserted except for the text field attributes.
Adding a field to a PDF document that doesn't contain any fields will set the document's default text field attributes to font Helvetica, font size 0, text color black.
Only signature fields can be added to PDF documents having signed signature fields.
TIFF documents support signature fields only and all signature fields must be inserted before the first signature is added to the document (you may want to use invisible fields) unless all existing signature fields have flag f_EnableAddAfterSigning set.
[in,out] | aField | The new field. The font resource name of the default text field attributes may be modified. The value index and the value may be modified for radio button fields and check box fields. |
[in] | aFlags | Flags modifying the behavior of this function, see enum SetFieldFlags. |
ReturnCode de::softpro::doc::SignDocDocument::addImageFromBlob | ( | int | aTargetPage, |
const unsigned char * | aPtr, | ||
size_t | aSize, | ||
double | aZoom, | ||
double | aX, | ||
double | aY, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags | ||
) | [inline] |
Add an image (from a blob) to a page.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aPtr | Pointer to the first octet of the blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aSize | Size (in octets) of the blob pointed to by aPtr. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Page height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ImportImageFlags. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
ReturnCode de::softpro::doc::SignDocDocument::addImageFromFile | ( | int | aTargetPage, |
Encoding | aEncoding, | ||
const std::string & | aPath, | ||
double | aZoom, | ||
double | aX, | ||
double | aY, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags | ||
) | [inline] |
Add an image (from a file) to a page.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aEncoding | The encoding of aPath. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Page height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ImportImageFlags. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
ReturnCode de::softpro::doc::SignDocDocument::addPage | ( | int | aTargetPage, |
double | aWidth, | ||
double | aHeight | ||
) | [inline] |
Add an empty page to the document.
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aWidth | The width of the page (in 1/72 inches for PDF documents). |
[in] | aHeight | The height of the page (in 1/72 inches for PDF documents). |
ReturnCode de::softpro::doc::SignDocDocument::addSignature | ( | SignDocSignatureParameters * | aSignatureParameters, |
const SignDocVerificationParameters * | aVerificationParameters | ||
) | [inline] |
Sign the document.
This function stores changed properties in the document before signing. If string parameter "OutputPath" is set, the signed document will be stored in a new file specified by that parameter and the original file won't be modified. If "OutputPath" is not set, the document will be written to the file from which it was loaded or to which it was most recently saved.
If a PDF document is backed by memory (most recently loaded from memory or saved to a stream) and "OutputPath" is empty, the signed document will not be saved. Use
doc.copyToStream (stream, 0);
to save the signed document in that case.
If string parameter "OutputPath" is set to the special value "<memory>" for a PDF document, it will be saved to memory and signed in memory. You'll have to save the document as described in the preceding paragraph.
Some document types may allow adding signatures only if all signatures of the documents are valid.
If you are using RFC 3161 timestamps and get error rc_unexpected_error with a message like "Contents overflow: xxx vs. yyy", try using a bigger value for integer parameter "TimeStampSize".
[in] | aSignatureParameters | The signing parameters. The parameters can be used only once, for a single signature. |
[in] | aVerificationParameters | Verification parameters or NULL for default parameters. If revocation checking is enabled in aVerificationParameters, the revocation state of the certificates (subject to integer parameter "VerificationModel") in both the signing certificate's certificate chain and (if RFC 3161 time stamps are enabled) the RFC 3161 time stamp's certificate chain is checked. These verification parameters are not used for verifying the certificate chain of HTTPS connections to RFC 3161 time-stamp servers. |
ReturnCode de::softpro::doc::SignDocDocument::addText | ( | Encoding | aEncoding, |
const std::string & | aText, | ||
int | aPage, | ||
double | aX, | ||
double | aY, | ||
const std::string & | aFontName, | ||
double | aFontSize, | ||
const SignDocColor & | aTextColor, | ||
double | aOpacity, | ||
int | aFlags | ||
) | [inline] |
Add text to a page.
Multiple lines are not supported, the text must not contain CR and LF characters.
[in] | aEncoding | The encoding of aText and aFontName. |
[in] | aText | The text. Complex scripts are supported, see Complex Scripts. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX | The X coordinate of the reference point of the first character in document coordinates. |
[in] | aY | The Y coordinate of the reference point of the first character in document coordinates. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aTextColor | The text color. |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A must use an opacity of 1.0. |
[in] | aFlags | Must be 0. |
ReturnCode de::softpro::doc::SignDocDocument::addTextRect | ( | Encoding | aEncoding, |
const std::string & | aText, | ||
int | aPage, | ||
double | aX0, | ||
double | aY0, | ||
double | aX1, | ||
double | aY1, | ||
const std::string & | aFontName, | ||
double | aFontSize, | ||
double | aLineSkip, | ||
const SignDocColor & | aTextColor, | ||
double | aOpacity, | ||
HAlignment | aHAlignment, | ||
VAlignment | aVAlignment, | ||
int | aFlags | ||
) | [inline] |
Add text in a rectangle of a page (with line breaking).
Any sequence of CR and LF characters in the text starts a new paragraph (ie, text following such a sequence will be placed at the beginning of the next output line). In consequence, empty lines in the input do not produce empty lines in the output. To get an empty line in the output, you have to add a paragraph containing a non-breaking space (0xa0) only:
"Line before empty line\n\xa0\nLine after empty line"
[in] | aEncoding | The encoding of aText and aFontName. |
[in] | aText | The text. Allowed control characters are CR and LF. Any sequence of CR and LF characters starts a new paragraph. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX0 | X coordinate of lower left corner. |
[in] | aY0 | Y coordinate of lower left corner. |
[in] | aX1 | X coordinate of upper right corner. |
[in] | aY1 | Y coordinate of upper right corner. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aLineSkip | The vertical distance between the baselines of successive lines (usually 1.2 * aFontSize). |
[in] | aTextColor | The text color. |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A must use an opacity of 1.0. |
[in] | aHAlignment | Horizontal alignment of the text. |
[in] | aVAlignment | Vertical alignment of the text. |
[in] | aFlags | Must be 0. |
ReturnCode de::softpro::doc::SignDocDocument::addWatermark | ( | const SignDocWatermark & | aInput ) | [inline] |
Add a watermark.
[in] | aInput | An object describing the watermark. |
ReturnCode de::softpro::doc::SignDocDocument::applyFdf | ( | const wchar_t * | aPath, |
unsigned | aFlags | ||
) | [inline] |
Apply an FDF document to a PDF document.
FDF documents can be applied to PDF documents only.
[in] | aPath | The pathname of the FDF document. |
[in] | aFlags | Flags modifying the behavior of this function, see enum SetFieldFlags. |
ReturnCode de::softpro::doc::SignDocDocument::applyFdf | ( | Encoding | aEncoding, |
const char * | aPath, | ||
unsigned | aFlags | ||
) | [inline] |
Apply an FDF document to a PDF document.
FDF documents can be applied to PDF documents only.
[in] | aEncoding | The encoding of the string pointed to by aPath. |
[in] | aPath | The pathname of the FDF document. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps. |
[in] | aFlags | Flags modifying the behavior of this function, see enum SetFieldFlags. |
ReturnCode de::softpro::doc::SignDocDocument::changeAttachmentDescription | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
const std::string & | aDescription | ||
) | [inline] |
Change the description of an attachment of the document.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName and aDescription. |
[in] | aName | The name of the attachment. |
[in] | aDescription | The new description of the attachment. |
ReturnCode de::softpro::doc::SignDocDocument::checkAttachment | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
CheckAttachmentResult & | aOutput | ||
) | [inline] |
Check the checksum of an attachment.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The name of the attachment. |
[out] | aOutput | The result of the check will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::clearAllSignatures | ( | ) | [inline] |
ReturnCode de::softpro::doc::SignDocDocument::clearSignature | ( | Encoding | aEncoding, |
const std::string & | aFieldName | ||
) | [inline] |
Remove a signature of the document.
For some document formats (TIFF), signatures may only be cleared in the reverse order of signing (LIFO).
[in] | aEncoding | The encoding of aFieldName. |
[in] | aFieldName | The name of the signature field encoded according to aEncoding. |
ReturnCode de::softpro::doc::SignDocDocument::computeZoom | ( | double & | aOutput, |
const SignDocRenderParameters & | aParams | ||
) | [inline] |
Compute the zoom factor used for rendering.
If SignDocRenderParameters::fitWidth(), SignDocRenderParameters::fitHeight(), or SignDocRenderParameters::fitRect() has been called, the actual factor depends on the document's page size. If multiple pages are selected (see SignDocRenderParameters::setPages()), the maximum width and maximum height of all selected pages will be used.
[out] | aOutput | The zoom factor will be stored here. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
ReturnCode de::softpro::doc::SignDocDocument::convCanvasPointToPagePoint | ( | Point & | aPoint, |
const SignDocRenderParameters & | aParams | ||
) | [inline] |
Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the current page.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (see SignDocRenderParameters::setPages()), the first page of the range will be used.
Suppose the current page of a PDF document has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,PH) and point (0,IH) will be converted to (0,0).
[in,out] | aPoint | The point to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
ReturnCode de::softpro::doc::SignDocDocument::convPagePointToCanvasPoint | ( | Point & | aPoint, |
const SignDocRenderParameters & | aParams | ||
) | [inline] |
Convert a point expressed in document coordinate system of the current page to a point expressed in canvas (image) coordinates.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (see SignDocRenderParameters::setPages()), the first page of the range will be used.
Suppose the current page page of a PDF document has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,IH) and point (0,PH) will be converted to (0,0).
[in,out] | aPoint | The point to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
ReturnCode de::softpro::doc::SignDocDocument::copyAsSignedToStream | ( | Encoding | aEncoding, |
const std::string & | aFieldName, | ||
OutputStream & | aStream | ||
) | [inline] |
Copy the document to a stream for viewing the document "as signed".
This function copies to a stream the document as it was when the specified signature field was signed. If the specified signature field contains the last signature applied to the document, this function is equivalent to copyToStream(). However, for some document formats, this function may require signatures to be valid.
[in] | aEncoding | The encoding of aFieldName. |
[in] | aFieldName | The name of the signature field encoded according to aEncoding. |
[in] | aStream | The file will be copied to this stream. |
ReturnCode de::softpro::doc::SignDocDocument::copyToStream | ( | OutputStream & | aStream, |
unsigned | aFlags | ||
) | [inline] |
Copy the document's current status or backing file or backing blob to a stream.
If ctsf_unsaved is not set in aFlags , this function will copy to a stream the file or blob from which the document was loaded or to which the document was most recently saved. Changes made to the in-memory copy of the document since it was loaded or saved will not be reflected in the copy written to the stream.
If ctsf_unsaved is set in aFlags, unsaved changes made to the in-memory copy of the document will be included (as incremental update for PDF documents) in the stream.
This function does not have side effects on the in-memory copy of the document, that is, unsaved changes remain unsaved (except for being saved to the stream if ctsf_unsaved is set in aFlags).
[in] | aStream | The file will be copied to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, see enum CopyToStreamFlags. |
SignDocAnnotation* de::softpro::doc::SignDocDocument::createFreeTextAnnotation | ( | const Point & | aLowerLeft, |
const Point & | aUpperRight | ||
) | [inline] |
Create a text annotation.
See SignDocAnnotation for details. This function uses document (page) coordinates, see Coordinate Systems.
[in] | aLowerLeft | coordinates of lower left corner. |
[in] | aUpperRight | coordinates of upper right corner. |
SignDocAnnotation* de::softpro::doc::SignDocDocument::createFreeTextAnnotation | ( | double | aX0, |
double | aY0, | ||
double | aX1, | ||
double | aY1 | ||
) | [inline] |
Create a text annotation.
See SignDocAnnotation for details. This function uses document (page) coordinates, see Coordinate Systems.
[in] | aX0 | X coordinate of lower left corner. |
[in] | aY0 | Y coordinate of lower left corner. |
[in] | aX1 | X coordinate of upper right corner. |
[in] | aY1 | Y coordinate of upper right corner. |
SignDocAnnotation* de::softpro::doc::SignDocDocument::createLineAnnotation | ( | double | aStartX, |
double | aStartY, | ||
double | aEndX, | ||
double | aEndY | ||
) | [inline] |
Create a line annotation.
See SignDocAnnotation for details. This function uses document (page) coordinates, see Coordinate Systems.
[in] | aStartX | X coordinate of start point. |
[in] | aStartY | Y coordinate of start point. |
[in] | aEndX | X coordinate of end point. |
[in] | aEndY | Y coordinate of end point. |
SignDocAnnotation* de::softpro::doc::SignDocDocument::createLineAnnotation | ( | const Point & | aStart, |
const Point & | aEnd | ||
) | [inline] |
Create a line annotation.
See SignDocAnnotation for details.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aStart | Start point. |
[in] | aEnd | End point. |
SignDocAnnotation* de::softpro::doc::SignDocDocument::createScribbleAnnotation | ( | ) | [inline] |
Create a scribble annotation.
See SignDocAnnotation for details. This function uses document (page) coordinates, see Coordinate Systems.
ReturnCode de::softpro::doc::SignDocDocument::createSignatureParameters | ( | const wchar_t * | aFieldName, |
const wchar_t * | aProfile, | ||
std::auto_ptr< SignDocSignatureParameters > & | aOutput | ||
) | [inline] |
Create a SignDocSignatureParameters object for signing a signature field.
The caller is responsible for destroying the object.
Each SignDocSignatureParameters object should be used for at most one signature.
The following profiles are available and documented:
Profile | Document Types | Description |
---|---|---|
"" | PDF, TIFF | Image above Signer and SignTime |
"image" | PDF, TIFF | Image only |
For TIFF documents, "" produces the same output as "image".
[in] | aFieldName | The name of the signature field. |
[in] | aProfile | The profile name (ASCII). Some document types and signature fields support different sets of default parameters. The default profile, "", is supported for all signature fields. |
[out] | aOutput | A pointer to the new parameters object will be stored here. The caller is responsible for destroying the object. |
ReturnCode de::softpro::doc::SignDocDocument::createSignatureParameters | ( | Encoding | aEncoding, |
const std::string & | aFieldName, | ||
const std::string & | aProfile, | ||
std::auto_ptr< SignDocSignatureParameters > & | aOutput | ||
) | [inline] |
Create a SignDocSignatureParameters object for signing a signature field.
The caller is responsible for destroying the object.
Each SignDocSignatureParameters object should be used for at most one signature.
The following profiles are available and documented:
Profile | Document Types | Description |
---|---|---|
"" | PDF, TIFF | Image above Signer and SignTime |
"image" | PDF, TIFF | Image only |
For TIFF documents, "" produces the same output as "image".
[in] | aEncoding | The encoding of aFieldName. |
[in] | aFieldName | The name of the signature field, encoded according to aEncoding. |
[in] | aProfile | The profile name (ASCII). Some document types and signature fields support different sets of default parameters. The default profile, "", is supported for all signature fields. |
[out] | aOutput | A pointer to the new parameters object will be stored here. The caller is responsible for destroying the object. |
ReturnCode de::softpro::doc::SignDocDocument::exportFields | ( | OutputStream & | aStream, |
int | aFlags | ||
) | [inline] |
Export all fields as XML.
This function always uses UTF-8 encoding. The output conforms to schema PdfFields.xsd.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aStream | The fields will be saved to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ExportFlags. |
ReturnCode de::softpro::doc::SignDocDocument::exportProperties | ( | const std::string & | aCollection, |
OutputStream & | aStream, | ||
int | aFlags | ||
) | [inline] |
Export properties as XML.
This function always uses UTF-8 encoding. The output conforms to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, all properties of the "public" and "encrypted" collections will be exported. |
[in] | aStream | The properties will be saved to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ExportFlags. |
ReturnCode de::softpro::doc::SignDocDocument::findText | ( | Encoding | aEncoding, |
int | aFirstPage, | ||
int | aLastPage, | ||
const std::string & | aText, | ||
int | aFlags, | ||
std::vector< SignDocFindTextPosition > & | aOutput | ||
) | [inline] |
Find text.
[in] | aEncoding | The encoding of aText. |
[in] | aFirstPage | 1-based number of first page to be searched. |
[in] | aLastPage | 1-based number of last page to be searched or 0 to search to the end of the document. |
[in] | aText | Text to be searched for. Multiple successive spaces are treated as single space (and may be ignored subject to aFlags). |
[in] | aFlags | Flags modifying the behavior of this function, see enum FindTextFlags. |
[out] | aOutput | The positions where aText was found. |
ReturnCode de::softpro::doc::SignDocDocument::flattenField | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
int | aWidget | ||
) | [inline] |
Flatten a field.
Flattening a field of a PDF document makes its appearance part of the page and removes the selected widget or all widgets; the field will be removed when all its widgets have been flattened.
Flattening unsigned signature fields does not work correctly.
Flattening fields breaks existing signatures. If you are flattening fields only for printing with PDF components that don't support annotations, make a copy of the document, pass
to setShootInFoot(), flatten the fields, print the document, and throw it away.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The fully-qualified name of the field. |
[in] | aWidget | The widget index to flatten only one widget or -1 to flatten all widgets. |
ReturnCode de::softpro::doc::SignDocDocument::flattenFields | ( | int | aFirstPage, |
int | aLastPage, | ||
unsigned | aFlags | ||
) | [inline] |
Flatten all fields of the document or of a range of pages.
Flattening a field of a PDF document makes its appearance part of the page and removes the selected widget or all widgets; the field will be removed when all its widgets have been flattened. This function selects all widgets on the specified pages.
Flattening unsigned signature fields does not work correctly.
Flattening fields breaks existing signatures. If you are flattening fields only for printing with PDF components that don't support annotations, make a copy of the document, pass
to setShootInFoot(), flatten the fields, print the document, and throw it away.
[in] | aFirstPage | 1-based number of first page. |
[in] | aLastPage | 1-based number of last page or 0 to process all pages to the end of the document. |
[in] | aFlags | Flags modifying the behavior of this function, see FlattenFieldsFlags. If this value is 0, signature fields and hidden/invisible widgets will not be flattened. |
ReturnCode de::softpro::doc::SignDocDocument::getAnnotation | ( | Encoding | aEncoding, |
int | aPage, | ||
const std::string & | aName, | ||
std::auto_ptr< SignDocAnnotation > & | aOutput | ||
) | [inline] |
Get a named annotation of a page.
All setters will fail for the returned object.
[in] | aEncoding | The encoding of aName. |
[in] | aPage | The page number (1 for the first page). |
[in] | aName | The name of the annotation. |
[out] | aOutput | A pointer to a new SignDocAnnotation object or NULL will be stored here. The caller is responsible for destroying that object. |
ReturnCode de::softpro::doc::SignDocDocument::getAnnotations | ( | Encoding | aEncoding, |
int | aPage, | ||
std::vector< std::string > & | aOutput | ||
) | [inline] |
Get a list of all named annotations of a page.
Unnamed annotations are ignored by this function.
[in] | aEncoding | The encoding to be used for the names of the annotations returned in aOutput. |
[in] | aPage | The page number (1 for the first page). |
[out] | aOutput | The names of the annotations will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getAttachment | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
SignDocAttachment & | aOutput | ||
) | [inline] |
Get information about an attachment.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The name of the attachment. |
[out] | aOutput | Information about the attachment will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getAttachmentBlob | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
std::vector< unsigned char > & | aOutput | ||
) | [inline] |
Get an attachment as blob.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The name of the attachment. |
[out] | aOutput | The attachment will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getAttachments | ( | Encoding | aEncoding, |
std::vector< std::string > & | aOutput | ||
) | [inline] |
Get a list of all attachments of the document.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding to be used for the names returned in aOutput. |
[out] | aOutput | The names of the document's attachments will be stored here. Use getAttachment() to get information for a single attachment. |
ReturnCode de::softpro::doc::SignDocDocument::getAttachmentStream | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
std::auto_ptr< InputStream > & | aOutput | ||
) | [inline] |
Get an InputStream for an attachment.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The name of the attachment. |
[out] | aOutput | A pointer to a new InputStream object will be stored here; the caller is responsible for deleting that object after use. The InputStream does not support seek(), tell(), and avail(). |
int de::softpro::doc::SignDocDocument::getAvailableMethods | ( | ) | [inline] |
Get a bitset indicating which signing methods are available for this document.
This document's signature fields offer a subset of the signing methods returned by this function.
ReturnCode de::softpro::doc::SignDocDocument::getBitsPerPixel | ( | int | aPage, |
int & | aBPP | ||
) | [inline] |
Get the number of bits per pixel (TIFF only).
Different pages of the document may have different numbers of bits per pixel.
[in] | aPage | The page number (1 for the first page). |
[out] | aBPP | The number of bits per pixel of the page (1, 8, 24, or 32) or 0 (for PDF documents) will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getBooleanProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
bool & | aValue | ||
) | [inline] |
Get the value of a SignDoc property (boolean).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
[in] | aEncoding | The encoding of aName. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[out] | aValue | The value will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getConversionFactors | ( | int | aPage, |
double & | aFactorX, | ||
double & | aFactorY | ||
) | [inline] |
Get the conversion factors for a page.
Different pages of the document may have different conversion factors. For TIFF documents, this function yields the same values as getResolution().
[in] | aPage | The page number (1 for the first page). |
[out] | aFactorX | Divide horizontal coordinates by this number to convert document coordinates to inches. The value will be 0.0 if the conversion factor is not available. |
[out] | aFactorY | Divide vertical coordinates by this number to convert document coordinates to inches. The value will be 0.0 if the conversion factor is not available. |
ReturnCode de::softpro::doc::SignDocDocument::getDataBlock | ( | std::vector< unsigned char > & | aOutput ) | [inline] |
Get the SignDoc data block of the document.
[out] | aOutput | Not used. |
const char* de::softpro::doc::SignDocDocument::getErrorMessage | ( | Encoding | aEncoding ) | const [inline] |
Get an error message for the last function call.
[in] | aEncoding | The encoding to be used for the error message. |
const wchar_t* de::softpro::doc::SignDocDocument::getErrorMessageW | ( | ) | const [inline] |
Get an error message for the last function call.
ReturnCode de::softpro::doc::SignDocDocument::getField | ( | Encoding | aEncoding, |
const std::string & | aName, | ||
SignDocField & | aOutput | ||
) | [inline] |
Get an interactive field by name.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The fully-qualified name of the field. |
[out] | aOutput | The field will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getFields | ( | int | aTypes, |
std::vector< SignDocField > & | aOutput | ||
) | [inline] |
Get all interactive fields of the specified types.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aTypes | 0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is a value of SignDocField::Type. |
[out] | aOutput | The fields will be stored here. They appear in the order in which they have been defined. |
ReturnCode de::softpro::doc::SignDocDocument::getFieldsOfPage | ( | int | aPage, |
int | aTypes, | ||
std::vector< SignDocField > & | aOutput | ||
) | [inline] |
Get all interactive fields of the specified page, in tab order.
If the document does not specify a tab order, the fields will be returned in widget order.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aPage | The 1-based page number. |
[in] | aTypes | 0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is a value of SignDocField::Type. |
[out] | aOutput | The fields will be stored here in tab order. There will be one element per widget (rather than per field); use SignDocField::getWidget() to find out which widget of the field is referenced. |
unsigned de::softpro::doc::SignDocDocument::getFlags | ( | ) | const [inline] |
SIGNDOC_Document* de::softpro::doc::SignDocDocument::getImpl | ( | ) | [inline] |
Internal function.
const SIGNDOC_Document* de::softpro::doc::SignDocDocument::getImpl | ( | ) | const [inline] |
Internal function.
ReturnCode de::softpro::doc::SignDocDocument::getIntegerProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
long & | aValue | ||
) | [inline] |
Get the value of a SignDoc property (integer).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
[in] | aEncoding | The encoding of aName. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[out] | aValue | The value will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getLastTimestamp | ( | std::string & | aTime ) | [inline] |
Get the timestamp used by the last successful call of addSignature().
This function may return a timestamp even if the last call of addSignature() was not successful. See also string parameters "Timestamp" and "TimeStampServerURL" of SignDocSignatureParameters.
[out] | aTime | The timestamp in ISO 8601 format (yyyy-mm-ddThh:mm:ss without milliseconds, with optional timezone (or an empty string if there is no timestamp available) will be stored here. |
int de::softpro::doc::SignDocDocument::getPageCount | ( | ) | const [inline] |
Get the number of pages.
ReturnCode de::softpro::doc::SignDocDocument::getPageSize | ( | int | aPage, |
double & | aWidth, | ||
double & | aHeight | ||
) | [inline] |
Get the size of a page.
Different pages of the document may have different sizes. Use getConversionFactors() to get factors for converting the page size from document coordinates to real world dimensions.
[in] | aPage | The page number (1 for the first page). |
[out] | aWidth | The width of the page (in document coordinates) will be stored here. |
[out] | aHeight | The height of the page (in document coordinates) will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getPathname | ( | Encoding | aEncoding, |
std::string & | aPath | ||
) | [inline] |
Get the current pathname of the document.
The pathname will be empty if the document is stored in memory (ie, if it has been loaded from memory or saved to a stream).
If a FDF document has been opened, this function will return the pathname of the referenced PDF file.
[in] | aEncoding | The encoding to be used for aPath. |
[out] | aPath | The pathname will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getProfiles | ( | Encoding | aEncoding, |
const std::string & | aFieldName, | ||
std::vector< std::string > & | aOutput | ||
) | [inline] |
Get a list of profiles for a signature field.
[in] | aEncoding | The encoding of aFieldName. |
[in] | aFieldName | The name of the signature field encoded according to aEncoding. |
[out] | aOutput | The names (ASCII) of all profiles supported by the signature field will be stored here, excluding the default profile "" which is always available. |
ReturnCode de::softpro::doc::SignDocDocument::getProperties | ( | const std::string & | aCollection, |
std::vector< SignDocProperty > & | aOutput | ||
) | [inline] |
Get the names and types of all SignDoc properties of a certain collection of properties of the document.
Use getBooleanProperty(), getIntegerProperty(), or getStringProperty() to get the values of the properties.
There are three collections of SignDoc document properties:
Using the same property name in the "encrypted" and "public" collections is not possible. Attempts to get, set, or remove a property in the wrong collection will fail with error code rc_wrong_collection. To move a property from one collection to another collection, first remove it from the source collection, then add it to the target collection.
The "pdfa" collection is read-only and a property name existing in that collection does not prevent that property name from appearing in one of the other collections.
The syntax of property names depends on the document type and the collection containing the property.
"public" properties of PDF documents are stored according to XMP in namespace "http://www.softpro.de/pdfa/signdoc/public/", therefore property names must be valid unqualified XML names, see the syntax of "Name" in the XML 1.1 specification at http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-common-syn (section 2.3 Common Syntactic Constructs).
For "encrypted" properties and any properties in TIFF documents, property names can contain arbitrary Unicode characters except for NUL.
[in] | aCollection | The name of the collection, see above. |
[out] | aOutput | The properties will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getRenderedSize | ( | SignDocRenderOutput & | aOutput, |
const SignDocRenderParameters & | aRenderParameters | ||
) | [inline] |
Get the size of the rendered page in pixels (without actually rendering it).
The returned values may be approximations for some document formats. If multiple pages are selected (see SignDocRenderParameters::setPages()), the maximum width and maximum height of all selected pages will be used.
[out] | aOutput | The width and height of the image that would be computed by renderPageAsImage() with aClipRect being NULL will be stored here. |
[in] | aRenderParameters | Parameters such as the page number. |
ReturnCode de::softpro::doc::SignDocDocument::getRequiredSaveToFileFlags | ( | int & | aOutput ) | [inline] |
Get all flags currently required for saveToFile().
This function currently stores sf_incremental (saving the document non-incrementally would destroy existing signatures) or 0 (the document may be saved non-incrementally) to aOutput.
[out] | aOutput | The flags will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getResolution | ( | int | aPage, |
double & | aResX, | ||
double & | aResY | ||
) | [inline] |
Get the resolution of a page.
Different pages of the document may have different resolutions. Use getConversionFactors() to get factors for converting document coordinates to real world coordinates.
[in] | aPage | The page number (1 for the first page). |
[out] | aResX | The horizontal resolution in DPI will be stored here. The value will be 0.0 if the resolution is not available. |
[out] | aResY | The vertical resolution in DPI will be stored here. The value will be 0.0 if the resolution is not available. |
ReturnCode de::softpro::doc::SignDocDocument::getSaveToFileFlags | ( | int & | aOutput ) | [inline] |
Get all flags currently valid for saveToFile().
Note that sf_incremental cannot be used together with sf_linearized even if all these flags are returned by this function. sf_pdfa_buttons is returned only if the document claims to be PDF/A-1-compliant.
[out] | aOutput | The flags will be stored here. |
ReturnCode de::softpro::doc::SignDocDocument::getSaveToStreamFlags | ( | int & | aOutput ) | [inline] |
Get all flags currently valid for saveToStream().
Note that sf_incremental cannot be used together with sf_linearized even if all these flags are returned by this function. sf_pdfa_buttons is returned only if the document claims to be PDF/A-1-compliant.
[out] | aOutput | The flags will be stored here. |
unsigned de::softpro::doc::SignDocDocument::getShootInFoot | ( | ) | const [inline] |
Get the flags set by setShootInFoot().
SPPDF_Document* de::softpro::doc::SignDocDocument::getSPPDFDocument | ( | bool | aDestroy ) | [inline] |
Get the underlying SPPDF_Document object.
[in] | aDestroy | false to let this SignDocDocument object live, true to destroy this SignDocDocument object. |
ReturnCode de::softpro::doc::SignDocDocument::getStringProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
std::string & | aValue | ||
) | [inline] |
Get the value of a SignDoc property (string).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
[in] | aEncoding | The encoding of aName and for aValue. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[out] | aValue | The value will be stored here, encoded according to aEncoding. |
ReturnCode de::softpro::doc::SignDocDocument::getTextFieldAttributes | ( | SignDocTextFieldAttributes & | aOutput ) | [inline] |
Get the document's default text field attributes.
[in,out] | aOutput | This object will be updated. |
DocumentType de::softpro::doc::SignDocDocument::getType | ( | ) | const [inline] |
Get the type of the document.
ReturnCode de::softpro::doc::SignDocDocument::importPageFromImageBlob | ( | int | aTargetPage, |
const unsigned char * | aPtr, | ||
size_t | aSize, | ||
double | aZoom, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags | ||
) | [inline] |
Import a page from a blob containing an image.
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aPtr | Pointer to the first octet of the blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aSize | Size (in octets) of the blob pointed to by aPtr. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ImportImageFlags. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
ReturnCode de::softpro::doc::SignDocDocument::importPageFromImageFile | ( | int | aTargetPage, |
Encoding | aEncoding, | ||
const std::string & | aPath, | ||
double | aZoom, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags | ||
) | [inline] |
Import a page from a file containing an image.
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aEncoding | The encoding of aPath. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See enum ImportImageFlags. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
ReturnCode de::softpro::doc::SignDocDocument::importPages | ( | int | aTargetPage, |
SignDocDocument * | aSource, | ||
int | aSourcePage, | ||
int | aPageCount, | ||
int | aFlags | ||
) | [inline] |
Import pages from another document.
This function is currently implemented for PDF documents only. The pages to be imported must not contain any interactive fields having names that are already used for interactive fields in the target document.
Page labels are currently ignored, that is, they will probably be messed up in the target document.
Logical structure is currently not imported.
[in] | aTargetPage | The 1-based number of the page before which to insert the copied pages. The pages will be appended if this value is 0. |
[in] | aSource | The document from which to copy the pages. aSource can be this. |
[in] | aSourcePage | The 1-based number of the first page (in the source document) to be copied. |
[in] | aPageCount | The number of pages to be copied. All pages of aSource starting with aSourcePage will be copied if this value is 0. |
[in] | aFlags | Must be zero. |
ReturnCode de::softpro::doc::SignDocDocument::importProperties | ( | const std::string & | aCollection, |
InputStream & | aStream, | ||
int | aFlags | ||
) | [inline] |
Import properties from XML.
The input must conform to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, properties will be imported into all collections, otherwise properties will be imported into the specified collection. |
[in] | aStream | The properties will be read from this stream. This function reads the input completely, it doesn't stop at the end tag. |
[in] | aFlags | Flags modifying the behavior of this function, see enum ImportFlags. |
ReturnCode de::softpro::doc::SignDocDocument::isModified | ( | bool & | aModified ) | const [inline] |
Check if the document has unsaved changes.
[out] | aModified | Will be set to true if the document has unsaved changes, will be set to false if the document does not have unsaved changes. |
ReturnCode de::softpro::doc::SignDocDocument::removeAnnotation | ( | Encoding | aEncoding, |
int | aPage, | ||
const std::string & | aName | ||
) | [inline] |
Remove an annotation identified by name.
[in] | aEncoding | The encoding of aName. |
[in] | aPage | The page number (1 for the first page). |
[in] | aName | The name of the annotation, must not be empty. |
ReturnCode de::softpro::doc::SignDocDocument::removeAttachment | ( | Encoding | aEncoding, |
const std::string & | aName | ||
) | [inline] |
Remove an attachment from the document.
Attachments are supported for PDF documents only.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The name of the attachment. |
ReturnCode de::softpro::doc::SignDocDocument::removeField | ( | Encoding | aEncoding, |
const std::string & | aName | ||
) | [inline] |
Remove a field.
Removing a field of a TIFF document will invalidate all signatures.
[in] | aEncoding | The encoding of aName. |
[in] | aName | The fully-qualified name of the field. |
ReturnCode de::softpro::doc::SignDocDocument::removePages | ( | const int * | aPagesPtr, |
int | aPagesCount, | ||
KeepOrRemove | aMode | ||
) | [inline] |
Remove pages from the document.
A document must have at least page. This function will fail if you attempt to remove all pages.
Fields will be removed if all their widgets are on removed pages.
Only signatures in signature fields having the SignDocField::f_SinglePage flag set can survive removal of pages.
[in] | aPagesPtr | Pointer to an array of one-based page numbers. The order does not matter, neither does the number of occurences of a page number. |
[in] | aPagesCount | Number of page numbers pointed to by aPagesPtr. |
[in] | aMode | Tell this function whether to keep or to remove the pages specified by aPagesPtr. |
ReturnCode de::softpro::doc::SignDocDocument::removePDFA | ( | unsigned | aFlags ) | [inline] |
Remove PDF/A conformance.
Some operations on PDF documents (such as using standard fonts) are not allowed in PDF/A documents. This function turns a PDF/A document into a plain document, enabling those operations.
This function is available for PDF documents only.
[in] | aFlags | Must be 0. |
ReturnCode de::softpro::doc::SignDocDocument::removePermissions | ( | unsigned | aFlags ) | [inline] |
Remove signatures that grant permissions.
If you want to modify (beyond adding signature fields, signing signature fields, and filling in form fields) a PDF document that has permissions granted to Adobe Reader by digital signatures, you have to remove those signatures first by calling this function. That action will remove the permissions for Adobe Reader but enable modifying the document without breaking those signatures.
Permissions granted via encryption are not altered by this function.
This function is available for PDF documents only.
[in] | aFlags | Must be 0. |
ReturnCode de::softpro::doc::SignDocDocument::removeProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName | ||
) | [inline] |
Remove a SignDoc property.
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
[in] | aEncoding | The encoding of aName. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
ReturnCode de::softpro::doc::SignDocDocument::renderPageAsImage | ( | std::vector< unsigned char > & | aImage, |
SignDocRenderOutput & | aOutput, | ||
const SignDocRenderParameters & | aRenderParameters, | ||
const SignDocVerificationParameters * | aVerificationParameters, | ||
const Rect * | aClipRect | ||
) | [inline] |
Render the selected page (or pages) as image.
[out] | aImage | The image will be stored here as a blob. |
[out] | aOutput | The image size will be stored here. |
[in] | aRenderParameters | Parameters such as the page number. |
[in] | aVerificationParameters | Parameters for verification of signatures. Used only if setDecorations(true) has been called for aRenderParameters. Currently, signatures are verified one after another and the "Timeout" integer parameter applies to each verification. Pass NULL for default parameters. |
[in] | aClipRect | The rectangle to be rendered (using document coordinates, see Coordinate Systems) or NULL to render the complete page. |
ReturnCode de::softpro::doc::SignDocDocument::saveToFile | ( | const wchar_t * | aPath, |
int | aFlags | ||
) | [inline] |
Save the document to a file.
After a successful call to this function, the document behaves as if it had been loaded from the specified file.
Saving a signed PDF document without sf_incremental will fail, see getRequiredSaveToFileFlags().
[in] | aPath | The pathname of the file to be created or overwritten. Pass NULL to save to the file from which the document was loaded or most recently saved (which will fail if the documment was loaded from memory or saved to a stream). |
[in] | aFlags | Set of flags (of enum SaveFlags, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. |
ReturnCode de::softpro::doc::SignDocDocument::saveToFile | ( | Encoding | aEncoding, |
const char * | aPath, | ||
int | aFlags | ||
) | [inline] |
Save the document to a file.
After a successful call to this function, the document behaves as if it had been loaded from the specified file.
Saving a signed PDF document without sf_incremental will fail, see getRequiredSaveToFileFlags().
[in] | aEncoding | The encoding of the string pointed to by aPath. |
[in] | aPath | The pathname of the file to be created or overwritten. Pass NULL to save to the file from which the document was loaded or most recently saved (which will fail if the documment was loaded from memory or saved to a stream). See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps. |
[in] | aFlags | Set of flags (of enum SaveFlags, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. |
ReturnCode de::softpro::doc::SignDocDocument::saveToStream | ( | OutputStream & | aStream, |
int | aFlags | ||
) | [inline] |
Save the document to a stream.
This function may have side effects on the document such as marking it as not modified which may render sf_incremental useless for the next saveToFile() call unless the document is changed between those two calls.
[in] | aStream | The document will be saved to this stream. |
[in] | aFlags | Set of flags (of enum SaveFlags, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. |
ReturnCode de::softpro::doc::SignDocDocument::setBooleanProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
bool | aValue | ||
) | [inline] |
Set the value of a SignDoc property (boolean).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
It's not possible to change the type of a property.
[in] | aEncoding | The encoding of aName. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
ReturnCode de::softpro::doc::SignDocDocument::setCompatibility | ( | int | aMajor, |
int | aMinor | ||
) | [inline] |
Request to not make changes to the document which are incompatible with an older version of this class.
No features introduced after aMajor.aMinor will be used.
Passing a version number before 1.11 or after the current version will fail.
[in] | aMajor | Major version number. |
[in] | aMinor | Minor version number. |
ReturnCode de::softpro::doc::SignDocDocument::setCompressionLevel | ( | int | aLevel ) | [inline] |
Set the FlateDecode compression level.
Calling this function has an effect for PDF documents only. You might want to use a low compression level on slow machines such as mobile devices. That will speed up operations such as embedding fonts, adding attachments, and adding images.
[in] | aLevel | The new compression level for encoding data with the FlateDecode filter. Allowed values are 0 (fastest, do not use FlateDecode), and 1 (fast, least compression) through 9 (slowest, best compression). The default value is 6. |
ReturnCode de::softpro::doc::SignDocDocument::setDataBlock | ( | const unsigned char * | aData, |
size_t | aSize | ||
) | [inline] |
Replace the SignDoc data block of the document.
[in] | aData | Not used. |
[in] | aSize | Not used. |
ReturnCode de::softpro::doc::SignDocDocument::setField | ( | SignDocField & | aField, |
unsigned | aFlags | ||
) | [inline] |
Change a field.
This function changes a field in the document using attributes from a SignDocField object. Everything except for the name and the type of the field can be changed. See the member functions of SignDocField for details.
Always get a SignDocField object for a field by calling getField(), getFields(), or getFields(), then apply your modifications to that object, then call setField().
The coordinates of the field are not changed unless sff_move is set in aFlags.
Do not try to build a SignDocField object from scratch for changing a field as future versions of the SignDocField class may have additional attributes.
This function is implemented for PDF documents only.
This function always fails for PDF documents that have signed signature fields.
[in,out] | aField | The field to be changed. The font resource name of the default text field attributes may be modified. The value index and the value may be modified for radio button fields and check box fields. |
[in] | aFlags | Flags modifying the behavior of this function, see enum SetFieldFlags. |
ReturnCode de::softpro::doc::SignDocDocument::setFlags | ( | unsigned | aFlags ) | [inline] |
Set flags modifying the behavior of various functions.
The default is value is 0.
[in] | aFlags | New set of flags, see enum Flags. |
void de::softpro::doc::SignDocDocument::setImpl | ( | SIGNDOC_Document * | aP ) | [inline] |
Internal function.
ReturnCode de::softpro::doc::SignDocDocument::setIntegerProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
long | aValue | ||
) | [inline] |
Set the value of a SignDoc property (integer).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
It's not possible to change the type of a property.
[in] | aEncoding | The encoding of aName. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
ReturnCode de::softpro::doc::SignDocDocument::setShootInFoot | ( | unsigned | aFlags ) | [inline] |
Disable safety checks.
The default value, 0, makes operations fail which would invalidate existing signatures (signature fields) or signatures granting permissions.
[in] | aFlags | New set of flags, see enum ShootInFootFlags. |
ReturnCode de::softpro::doc::SignDocDocument::setStringProperty | ( | Encoding | aEncoding, |
const std::string & | aCollection, | ||
const std::string & | aName, | ||
const std::string & | aValue | ||
) | [inline] |
Set the value of a SignDoc property (string).
In the "public" and "encrypted" collections, property names are compared under Unicode simple case folding, that is, lower case and upper case is not distinguished.
It's not possible to change the type of a property. Embedded NUL characters are not supported.
[in] | aEncoding | The encoding of aName and aValue. |
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
ReturnCode de::softpro::doc::SignDocDocument::setTextFieldAttributes | ( | SignDocTextFieldAttributes & | aData ) | [inline] |
Set the document's default text field attributes.
Font name, font size, and text color must be specified. This function fails if aData has any but not all attributes set or if any of the attributes are invalid.
This function fails for signed PDF document.
This function always fails for TIFF documents.
[in,out] | aData | The new default text field attributes. The font resource name will be updated. |
ReturnCode de::softpro::doc::SignDocDocument::verifySignature | ( | const wchar_t * | aFieldName, |
std::auto_ptr< SignDocVerificationResult > & | aOutput | ||
) | [inline] |
Verify a signature of the document.
[in] | aFieldName | The name of the signature field. |
[out] | aOutput | A pointer to a new SignDocVerificationResult object or NULL will be stored here. The caller is responsible for destroying that object. |
ReturnCode de::softpro::doc::SignDocDocument::verifySignature | ( | Encoding | aEncoding, |
const std::string & | aFieldName, | ||
std::auto_ptr< SignDocVerificationResult > & | aOutput | ||
) | [inline] |
Verify a signature of the document.
There is a setFlags() flag modifying the behavior of this function: f_relax_byte_range.
[in] | aEncoding | The encoding of aFieldName. |
[in] | aFieldName | The name of the signature field encoded according to aEncoding. |
[out] | aOutput | A pointer to a new SignDocVerificationResult object or NULL will be stored here. The caller is responsible for destroying that object. |