SignDoc SDK (.NET without exceptions)  5.0.0
SignDocDocument Class Reference

An interface for SignDoc documents. More...

Public Member Functions

 ~SignDocDocument ()
 Destructor. More...
 
 !SignDocDocument ()
 Finalizer. More...
 
void closeDocument ()
 Close the document and the underlying file. More...
 
DocumentType getType ()
 Get the type of the document. More...
 
int getPageCount ()
 Get the number of pages. More...
 
SignDocSignatureParameters createSignatureParameters (out ReturnCode aReturnCode, string aFieldName, string aProfile)
 Create a SignDocSignatureParameters object for signing a signature field. More...
 
SignDocSignatureParameters createSignatureParametersForTimeStamp (out ReturnCode aReturnCode)
 Create a SignDocSignatureParameters object for adding a document time stamp. More...
 
string[] getProfiles (out ReturnCode aReturnCode, string aFieldName)
 Get a list of profiles for a signature field. More...
 
void addSignature (out ReturnCode aReturnCode, SignDocSignatureParameters aSignatureParameters, SignDocVerificationParameters aVerificationParameters)
 Sign the document. More...
 
string getLastTimestamp (out ReturnCode aReturnCode)
 Get the timestamp used by the last successful call of addSignature(). More...
 
string getPathname (out ReturnCode aReturnCode)
 Get the current pathname of the document. More...
 
SigningMethodFlags getAvailableMethods ()
 Get a bitset indicating which signing methods are available for this document. More...
 
int getSignatureCount ()
 Get the number of signatures that can be retrieved with getSignature(). More...
 
SignDocSignature getSignature (out ReturnCode aReturnCode, int aIndex)
 Get a signature of the document. More...
 
SignDocVerificationResult verifySignature (out ReturnCode aReturnCode, string aFieldName)
 Verify a signature of the document. More...
 
SignDocVerificationResult verifySignature2 (out ReturnCode aReturnCode, SignDocSignature aSignature)
 Verify a signature of the document. More...
 
void clearSignature (out ReturnCode aReturnCode, string aFieldName)
 Remove a signature of the document. More...
 
void clearAllSignatures (out ReturnCode aReturnCode)
 Remove all signatures of the document. More...
 
void clearApprovalSignatures (out ReturnCode aReturnCode)
 Remove all approval signatures of the document. More...
 
int updateDSS (out ReturnCode aReturnCode, SignDocVerificationParameters aParameters, UpdateDSSFlags aFlags)
 Update the DSS for any eligible signatures of the document. More...
 
void updateDSS2 (out ReturnCode aReturnCode, string aFieldName, SignDocVerificationParameters aParameters, UpdateDSSFlags aFlags)
 Update the DSS for a signature of the document. More...
 
void saveToStream (out ReturnCode aReturnCode, Stream aStream, SaveFlags aFlags)
 Save the document to a stream. More...
 
byte[] saveToMemory (out ReturnCode aReturnCode, SaveFlags aFlags)
 Save the document to a blob. More...
 
void saveToFile (out ReturnCode aReturnCode, string aPath, SaveFlags aFlags)
 Save the document to a file. More...
 
void copyToStream (out ReturnCode aReturnCode, Stream aStream, CopyToStreamFlags aFlags)
 Copy the document's current status or backing file or backing blob to a stream. More...
 
byte[] copyToMemory (out ReturnCode aReturnCode, CopyToStreamFlags aFlags)
 Copy the document's current status or backing file or backing blob to a blob. More...
 
void copyAsSignedToStream (out ReturnCode aReturnCode, string aFieldName, Stream aStream)
 Copy the document to a stream for viewing the document "as signed". More...
 
byte[] copyAsSignedToMemory (out ReturnCode aReturnCode, string aFieldName)
 Copy the document to a blob for viewing the document "as signed". More...
 
SaveFlags getSaveToStreamFlags (out ReturnCode aReturnCode)
 Get all flags currently valid for saveToStream() and saveToMemory(). More...
 
SaveFlags getSaveToFileFlags (out ReturnCode aReturnCode)
 Get all flags currently valid for saveToFile(). More...
 
SaveFlags getRequiredSaveToFileFlags (out ReturnCode aReturnCode)
 Get all flags currently required for saveToFile(). More...
 
SignDocField[] getFields (out ReturnCode aReturnCode, FieldTypeFlags aTypes)
 Get all interactive fields of the specified types. More...
 
SignDocField[] getFieldsOfPage (out ReturnCode aReturnCode, int aPage, FieldTypeFlags aTypes)
 Get all interactive fields of the specified page, in tab order. More...
 
SignDocField getField (out ReturnCode aReturnCode, string aName)
 Get an interactive field by name. More...
 
void setField (out ReturnCode aReturnCode, SignDocField aField, SetFieldFlags aFlags)
 Change a field. More...
 
void addField (out ReturnCode aReturnCode, SignDocField aField, SetFieldFlags aFlags)
 Add a field. More...
 
void removeField (out ReturnCode aReturnCode, string aName)
 Remove a field. More...
 
void flattenField (out ReturnCode aReturnCode, string aName, int aWidget)
 Flatten a field. More...
 
void flattenFields (out ReturnCode aReturnCode, int aFirstPage, int aLastPage, FlattenFieldsFlags aFlags)
 Flatten all fields of the document or of a range of pages. More...
 
void exportFields (out ReturnCode aReturnCode, Stream aStream, ExportFlags aFlags)
 Export all fields as XML to a stream. More...
 
byte[] exportFieldsToMemory (out ReturnCode aReturnCode, ExportFlags aFlags)
 Export all fields as XML to a blob. More...
 
void applyFdf (out ReturnCode aReturnCode, string aPath, SetFieldFlags aFlags)
 Apply an FDF document to a PDF document. More...
 
SignDocTextFieldAttributes getTextFieldAttributes (out ReturnCode aReturnCode)
 Get the document's default text field attributes. More...
 
void setTextFieldAttributes (out ReturnCode aReturnCode, SignDocTextFieldAttributes aData)
 Set the document's default text field attributes. More...
 
SignDocProperty[] getProperties (out ReturnCode aReturnCode, string aCollection)
 Get the names and types of all SignDoc properties of a certain collection of properties of the document. More...
 
int? getIntegerProperty (string aCollection, string aName)
 Get the value of a SignDoc property (integer). More...
 
string getStringProperty (string aCollection, string aName)
 Get the value of a SignDoc property (string). More...
 
bool? getBooleanProperty (string aCollection, string aName)
 Get the value of a SignDoc property (boolean). More...
 
void setIntegerProperty (out ReturnCode aReturnCode, string aCollection, string aName, int aValue)
 Set the value of a SignDoc property (integer). More...
 
void setStringProperty (out ReturnCode aReturnCode, string aCollection, string aName, string aValue)
 Set the value of a SignDoc property (string). More...
 
void setBooleanProperty (out ReturnCode aReturnCode, string aCollection, string aName, bool aValue)
 Set the value of a SignDoc property (boolean). More...
 
void removeProperty (out ReturnCode aReturnCode, string aCollection, string aName)
 Remove a SignDoc property. More...
 
byte[] exportPropertiesToMemory (out ReturnCode aReturnCode, string aCollection, ExportFlags aFlags)
 Export properties as XML to a blob. More...
 
void exportProperties (out ReturnCode aReturnCode, string aCollection, Stream aStream, ExportFlags aFlags)
 Export properties as XML. More...
 
void importProperties (out ReturnCode aReturnCode, string aCollection, InputStream aStream, ImportFlags aFlags)
 Import properties from XML (reading a stresm). More...
 
void importPropertiesFromMemory (out ReturnCode aReturnCode, string aCollection, byte[] aBlob, ImportFlags aFlags)
 Import properties from XML (reading a blob). More...
 
double getResolutionX (out ReturnCode aReturnCode, int aPage)
 Get the horizontal resolution of a page. More...
 
double getResolutionY (out ReturnCode aReturnCode, int aPage)
 Get the vertical resolution of a page. More...
 
double getConversionFactorX (out ReturnCode aReturnCode, int aPage)
 Get the horizontal conversion factor for a page. More...
 
double getConversionFactorY (out ReturnCode aReturnCode, int aPage)
 Get the vertical conversion factor for a page. More...
 
double getPageWidth (out ReturnCode aReturnCode, int aPage)
 Get the width of a page. More...
 
double getPageHeight (out ReturnCode aReturnCode, int aPage)
 Get the height of a page. More...
 
string getPageLabel (out ReturnCode aReturnCode, int aPage)
 Get the page label for a page number. More...
 
int getBitsPerPixel (out ReturnCode aReturnCode, int aPage)
 Get the number of bits per pixel (TIFF only). More...
 
double computeZoom (out ReturnCode aReturnCode, SignDocRenderParameters aParams)
 Compute the zoom factor used for rendering. More...
 
void convCanvasPointToPagePoint (out ReturnCode aReturnCode, Point aPoint, SignDocRenderParameters aParams)
 Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the specified page. More...
 
void convPagePointToCanvasPoint (out ReturnCode aReturnCode, Point aPoint, SignDocRenderParameters aParams)
 Convert a point expressed in document coordinate system of the specified page to a point expressed in canvas (image) coordinates. More...
 
Rect convImageRectToPageRect (out ReturnCode aReturnCode, SignDocImageRect aInput, SignDocRenderParameters aParams)
 Convert a rectangle expressed in canvas (image) coordinates to a rectangle expressed in document coordinate system of the specified page. More...
 
SignDocImageRect convPageRectToImageRect (out ReturnCode aReturnCode, Rect aInput, SignDocRenderParameters aParams)
 Convert a rectangle expressed in document coordinate system of the specified page to a rectangle expressed in canvas (image) coordinates. More...
 
byte[] renderPageAsImage (out ReturnCode aReturnCode, SignDocRenderOutput aOutput, SignDocRenderParameters aRenderParameters, SignDocVerificationParameters aVerificationParameters, Rect aClipRect)
 Render the selected page (or pages) as image. More...
 
SignDocImage renderPageAsSignDocImage (out ReturnCode aReturnCode, SignDocRenderOutput aOutput, SignDocRenderParameters aRenderParameters, SignDocVerificationParameters aVerificationParameters, Rect aClipRect)
 Render the selected page (or pages) as SignDocImage object. More...
 
SignDocRenderOutput getRenderedSize (out ReturnCode aReturnCode, SignDocRenderParameters aParams)
 Get the size of the rendered page in pixels (without actually rendering it). More...
 
SignDocAnnotation createLineAnnotation (Point aStart, Point aEnd)
 Create a line annotation. More...
 
SignDocAnnotation createLineAnnotation (double aStartX, double aStartY, double aEndX, double aEndY)
 Create a line annotation. More...
 
SignDocAnnotation createScribbleAnnotation ()
 Create a scribble annotation. More...
 
SignDocAnnotation createFreeTextAnnotation (Point aLowerLeft, Point aUpperRight)
 Create a text annotation. More...
 
SignDocAnnotation createFreeTextAnnotation (double aX0, double aY0, double aX1, double aY1)
 Create a text annotation. More...
 
void addAnnotation (out ReturnCode aReturnCode, int aPage, SignDocAnnotation aAnnot)
 Add an annotation to a page. More...
 
string[] getAnnotations (out ReturnCode aReturnCode, int aPage)
 Get a list of all named annotations of a page. More...
 
SignDocAnnotation getAnnotation (out ReturnCode aReturnCode, int aPage, string aName)
 Get a named annotation of a page. More...
 
void removeAnnotation (out ReturnCode aReturnCode, int aPage, string aName)
 Remove an annotation identified by name. More...
 
void flattenAnnotations (out ReturnCode aReturnCode, int aFirstPage, int aLastPage, FlattenAnnotationsFlags aFlags)
 Flatten all annotations of the document or of a range of pages. More...
 
void addText (out ReturnCode aReturnCode, string aText, int aPage, double aX, double aY, string aFontName, double aFontSize, SignDocColor aTextColor, double aOpacity, AddTextFlags aFlags)
 Add text to a page. More...
 
void addText2 (out ReturnCode aReturnCode, string aText, int aPage, double aX, double aY, string aFontName, double aFontSize, SignDocColor aTextColor, double aOpacity, AddTextFlags aFlags, string aLang)
 Add text to a page (with language identifier). More...
 
void addTextRect (out ReturnCode aReturnCode, string aText, int aPage, double aX0, double aY0, double aX1, double aY1, string aFontName, double aFontSize, double aLineSkip, SignDocColor aTextColor, double aOpacity, DocumentHAlignment aHAlignment, DocumentVAlignment aVAlignment, AddTextRectFlags aFlags)
 Add text in a rectangle of a page (with line breaking). More...
 
void addTextRect2 (out ReturnCode aReturnCode, string aText, int aPage, double aX0, double aY0, double aX1, double aY1, string aFontName, double aFontSize, double aLineSkip, SignDocColor aTextColor, double aOpacity, DocumentHAlignment aHAlignment, DocumentVAlignment aVAlignment, AddTextRectFlags aFlags, string aLang)
 Add text in a rectangle of a page (with line breaking and language identifier). More...
 
void addWatermark (out ReturnCode aReturnCode, SignDocWatermark aInput)
 Add a watermark. More...
 
SignDocFindTextOccurrence[] findText (out ReturnCode aReturnCode, int aFirstPage, int aLastPage, string aText, FindTextFlags aFlags)
 Find text. More...
 
SignDocTextIterator createTextIterator (out ReturnCode aReturnCode, int aFirstPage, int aLastPage, CreateTextIteratorFlags aFlags)
 Create an iterator that visits all the text of a range of pages. More...
 
void addAttachmentBlob (out ReturnCode aReturnCode, string aName, string aDescription, string aType, string aModificationTime, byte[] aData, AddAttachmentFlags aFlags)
 Add an attachment to the document. More...
 
void addAttachmentFile (out ReturnCode aReturnCode, string aName, string aDescription, string aType, string aPath, AddAttachmentFlags aFlags)
 Add an attachment (read from a file) to the document. More...
 
void removeAttachment (out ReturnCode aReturnCode, string aName)
 Remove an attachment from the document. More...
 
void changeAttachmentDescription (out ReturnCode aReturnCode, string aName, string aDescription)
 Change the description of an attachment of the document. More...
 
string[] getAttachments (out ReturnCode aReturnCode)
 Get a list of all attachments of the document. More...
 
SignDocAttachment getAttachment (out ReturnCode aReturnCode, string aName)
 Get information about an attachment. More...
 
CheckAttachmentResult checkAttachment (out ReturnCode aReturnCode, string aName)
 Check the checksum of an attachment. More...
 
byte[] getAttachmentBlob (out ReturnCode aReturnCode, string aName)
 Get an attachment as blob. More...
 
InputStream getAttachmentStream (out ReturnCode aReturnCode, string aName)
 Get an InputStream for an attachment. More...
 
void addPage (out ReturnCode aReturnCode, int aTargetPage, double aWidth, double aHeight)
 Add an empty page to the document. More...
 
void importPages (out ReturnCode aReturnCode, int aTargetPage, SignDocDocument aSource, int aSourcePage, int aPageCount, ImportPagesFlags aFlags)
 Import pages from another document. More...
 
void importPageFromImageBlob (out ReturnCode aReturnCode, int aTargetPage, byte[] aData, double aZoom, double aWidth, double aHeight, ImportImageFlags aFlags)
 Import a page from a blob containing an image. More...
 
void importPageFromImageBlob2 (out ReturnCode aReturnCode, int aTargetPage, byte[] aData, double aZoom, double aWidth, double aHeight, ImportImageFlags aFlags, string aDescription, string aLang)
 Import a page from a blob containing an image (with alternate description). More...
 
void importPageFromImageFile (out ReturnCode aReturnCode, int aTargetPage, string aPath, double aZoom, double aWidth, double aHeight, ImportImageFlags aFlags)
 Import a page from a file containing an image. More...
 
void importPageFromImageFile2 (out ReturnCode aReturnCode, int aTargetPage, string aPath, double aZoom, double aWidth, double aHeight, ImportImageFlags aFlags, string aDescription, string aLang)
 Import a page from a file containing an image (with alternate description). More...
 
void addImageFromMemory (out ReturnCode aReturnCode, int aTargetPage, byte[] aData, double aZoom, double aX, double aY, double aWidth, double aHeight, ImportImageFlags aFlags)
 Add an image (from a blob) to a page. More...
 
void addImageFromMemory2 (out ReturnCode aReturnCode, int aTargetPage, byte[] aData, double aZoom, double aX, double aY, double aWidth, double aHeight, ImportImageFlags aFlags, string aDescription, string aLang)
 Add an image (from a blob) to a page (with alternate description). More...
 
void addImageFromFile (out ReturnCode aReturnCode, int aTargetPage, string aPath, double aZoom, double aX, double aY, double aWidth, double aHeight, ImportImageFlags aFlags)
 Add an image (from a file) to a page. More...
 
void addImageFromFile2 (out ReturnCode aReturnCode, int aTargetPage, string aPath, double aZoom, double aX, double aY, double aWidth, double aHeight, ImportImageFlags aFlags, string aDescription, string aLang)
 Add an image (from a file) to a page (with alternate description). More...
 
void removePages (out ReturnCode aReturnCode, ConstArray(int) aPages, KeepOrRemove aMode)
 Remove pages from the document. More...
 
void setCompatibility (out ReturnCode aReturnCode, int aMajor, int aMinor)
 Request to not make changes to the document which are incompatible with an older version of this class. More...
 
bool isModified (out ReturnCode aReturnCode)
 Check if the document has unsaved changes. More...
 
bool isTaggedPDF (out ReturnCode aReturnCode)
 Check if the document is a Tagged PDF document. More...
 
void setFlags (out ReturnCode aReturnCode, DocumentFlags aFlags)
 Set flags modifying the behavior of various functions. More...
 
DocumentFlags getFlags ()
 Get the flags set by setFlags(). More...
 
void setCompressionLevel (out ReturnCode aReturnCode, int aLevel)
 Set the FlateDecode compression level. More...
 
int getDocMDP ()
 Get the DocMDP P value of the document's certification signature. More...
 
int getLockMDP ()
 Get the lowest lock MDP value of the signed signature fields. More...
 
void removeDocMDP (out ReturnCode aReturnCode)
 Remove any certification signature. More...
 
void removePermissions (out ReturnCode aReturnCode, RemoveFlags aFlags)
 Remove signatures that grant permissions. More...
 
void removePDFA (out ReturnCode aReturnCode, RemoveFlags aFlags)
 Remove PDF/A conformance. More...
 
void removePDFUA (out ReturnCode aReturnCode, RemoveFlags aFlags)
 Remove PDF/UA conformance. More...
 
void removeLogicalStructure (out ReturnCode aReturnCode, RemoveFlags aFlags)
 Remove the logical structure. More...
 
void removeXFA (out ReturnCode aReturnCode, RemoveFlags aFlags)
 Remove XFA (XML Forms Architecture) content. More...
 
string getDocumentLanguage ()
 Get the document's natural language. More...
 
void setDocumentLanguage (out ReturnCode aReturnCode, string aLang)
 Set the document's natural language. More...
 
void setDefaultDocumentLanguage (out ReturnCode aReturnCode, string aLang)
 Set the language identifier to be used if a language identifier is required but the document doesn't provide one. More...
 
void setShootInFoot (out ReturnCode aReturnCode, ShootInFootFlags aFlags)
 Disable safety checks. More...
 
ShootInFootFlags getShootInFoot ()
 Get the flags set by setShootInFoot(). More...
 
string getErrorMessage ()
 Get an error message for the last function call. More...
 

Static Public Member Functions

static string[] splitEscapeSequences (string aInput)
 Split a string obtained from a PDF text string into escape sequences and text segments. More...
 
static string withoutEscapeSequences (string aInput)
 Remove escape sequences specifying the natural language in text strings. More...
 
static string withEscapeSequence (string aText, string aLang)
 Prepend an escape sequence for specifying the natural language in a text string. More...
 

Detailed Description

An interface for SignDoc documents.

An object of this class represents one document.

Use SignDocDocumentLoader.loadFromMemory(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.createPDF(), or SignDocDocumentLoader.createPDFA() 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:

Constructor & Destructor Documentation

Destructor.

Finalizer.

Member Function Documentation

void addAnnotation ( out ReturnCode  aReturnCode,
int  aPage,
SignDocAnnotation  aAnnot 
)

Add an annotation to a page.

See SignDocAnnotation for details.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
[in]aAnnotThe new annotation.
See also
createLineAnnotation(), createScribbleAnnotation(), createFreeTextAnnotation(), DocumentFlags.FailForBrokenTargetStructure
void addAttachmentBlob ( out ReturnCode  aReturnCode,
string  aName,
string  aDescription,
string  aType,
string  aModificationTime,
byte[]  aData,
AddAttachmentFlags  aFlags 
)

Add an attachment to the document.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons.
[in]aDescriptionThe description of the attachment (can be empty).
[in]aTypeThe MIME type of the attachment (can be empty except for PDF/A-3 documents).
[in]aModificationTimeThe 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]aDataThe attachment.
[in]aFlagsMust be AddAttachmentFlags.Zero.
See also
addAttachmentFile(), getAttachments(), removeAttachment()
void addAttachmentFile ( out ReturnCode  aReturnCode,
string  aName,
string  aDescription,
string  aType,
string  aPath,
AddAttachmentFlags  aFlags 
)

Add an attachment (read from a file) to the document.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons.
[in]aDescriptionThe description of the attachment (can be empty).
[in]aTypeThe MIME type of the attachment (can be empty except for PDF/A-3 documents).
[in]aPathThe pathname of the file to be attached.
[in]aFlagsMust be AddAttachmentFlags.Zero.
See also
addAttachmentBlob(), getAttachments(), removeAttachment()
void addField ( out ReturnCode  aReturnCode,
SignDocField  aField,
SetFieldFlags  aFlags 
)

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 FieldFlags.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 FieldFlags.EnableAddAfterSigning set.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aFieldThe 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]aFlagsSet of flags (of enum SetFieldFlags, combined with `|') modifying the behavior of this function. Pass 0 for no flags.
See also
getField(), removeField(), setField(), setTextFieldAttributes(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireAlternateFieldName
void addImageFromFile ( out ReturnCode  aReturnCode,
int  aTargetPage,
string  aPath,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags 
)

Add an image (from a file) to a page.

This function behaves like addImageFromFile2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use addImageFromFile2() with a meaningful description of the image.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page.
[in]aPathThe pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aXThe X coordinate of the point at which the lower left corner of the image shall be placed.
[in]aYThe Y coordinate of the point at which the lower left corner of the image shall be placed.
[in]aWidthImage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aHeightPage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
See also
addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageBlob2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void addImageFromFile2 ( out ReturnCode  aReturnCode,
int  aTargetPage,
string  aPath,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags,
string  aDescription,
string  aLang 
)

Add an image (from a file) to a page (with alternate description).

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page.
[in]aPathThe pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aXThe X coordinate of the point at which the lower left corner of the image shall be placed.
[in]aYThe Y coordinate of the point at which the lower left corner of the image shall be placed.
[in]aWidthImage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aHeightPage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
[in]aDescriptionAlternate description for the image. If this value is an empty string, aLang will be ignored. If this value is an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used.
[in]aLangLanguage identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US".
See also
addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageBlob2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void addImageFromMemory ( out ReturnCode  aReturnCode,
int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags 
)

Add an image (from a blob) to a page.

This function behaves like addImageFromMemory2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use addImageFromMemory2() with a meaningful description of the image.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page.
[in]aDatahe blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aXThe X coordinate of the point at which the lower left corner of the image shall be placed.
[in]aYThe Y coordinate of the point at which the lower left corner of the image shall be placed.
[in]aWidthImage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aHeightPage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
See also
addImageFromFile(), addImageFromFile2(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageBlob2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void addImageFromMemory2 ( out ReturnCode  aReturnCode,
int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags,
string  aDescription,
string  aLang 
)

Add an image (from a blob) to a page (with alternate description).

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page.
[in]aDataThe blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aXThe X coordinate of the point at which the lower left corner of the image shall be placed.
[in]aYThe Y coordinate of the point at which the lower left corner of the image shall be placed.
[in]aWidthImage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aHeightPage 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 ImportImageFlags.KeepAspectRatio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
[in]aDescriptionAlternate description for the image. If this value is an empty string, aLang will be ignored. If this value is an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used.
[in]aLangLanguage identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US".
See also
addImageFromFile2(), addImageFromMemory(), importPageFromImageBlob(), importPageFromImageBlob2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void addPage ( out ReturnCode  aReturnCode,
int  aTargetPage,
double  aWidth,
double  aHeight 
)

Add an empty page to the document.

This function is currently implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the new page. The page will be appended if this value is 0.
[in]aWidthThe width of the page (in 1/72 inches for PDF documents).
[in]aHeightThe height of the page (in 1/72 inches for PDF documents).
void addSignature ( out ReturnCode  aReturnCode,
SignDocSignatureParameters  aSignatureParameters,
SignDocVerificationParameters  aVerificationParameters 
)

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, CopyToStreamFlags.Zero);

or

byte[] blob = doc.copyToMemory (CopyToStreamFlags.Zero);

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.

For PDF documents, this function either signs or certifies the document, see integer parameter DocMDP.

If you are using RFC 3161 timestamps and get SignDocUnexpectedErrorException with a message like "Contents overflow: xxx vs. yyy", try using a bigger value for integer parameter "TimeStampSize".

This function performs a basic verification of the signature after signing a PDF document unless ShootInFootFlags.DontVerifyAfterSigning is set. This ensures that the private key matches the certificate. If that verification fails, ReturnCode.InvalidSignature will be returned.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aSignatureParametersThe signing parameters. The parameters can be used only once, for a single signature.
[in]aVerificationParametersVerification 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.
See also
copyToMemory(), copyToStream(), createSignatureParameters(), createSignatureParametersForTimeStamp(), getPathname(), setStringProperty()
void addText ( out ReturnCode  aReturnCode,
string  aText,
int  aPage,
double  aX,
double  aY,
string  aFontName,
double  aFontSize,
SignDocColor  aTextColor,
double  aOpacity,
AddTextFlags  aFlags 
)

Add text to a page.

This function behaves like addText2() with an empty string for aLang.

Multiple lines are not supported, the text must not contain CR and LF characters.

Note
addTextRect() is better than addText() for RTL text.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTextThe text. Complex scripts are supported, see Complex Scripts. Escape sequences must not be used.
[in]aPageThe 1-based page number of the page.
[in]aXThe X coordinate of the reference point of the visually left-most character in document coordinates, see Coordinate Systems.
[in]aYThe Y coordinate of the reference point of the visually left-most character in document coordinates.
[in]aFontNameThe 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]aFontSizeThe font size (in user space units).
[in]aTextColorThe text color.
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0.
[in]aFlagsMust be AddTextFlags.Zero.
See also
addText2(), addTextRect(), addWatermark(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireLang, SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigStream()
void addText2 ( out ReturnCode  aReturnCode,
string  aText,
int  aPage,
double  aX,
double  aY,
string  aFontName,
double  aFontSize,
SignDocColor  aTextColor,
double  aOpacity,
AddTextFlags  aFlags,
string  aLang 
)

Add text to a page (with language identifier).

Multiple lines are not supported, the text must not contain CR and LF characters.

Note
addTextRect2() is better than addText2() for RTL text.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTextThe text. Complex scripts are supported, see Complex Scripts. Escape sequences must not be used.
[in]aPageThe 1-based page number of the page.
[in]aXThe X coordinate of the reference point of the visually left-most character in document coordinates, see Coordinate Systems.
[in]aYThe Y coordinate of the reference point of the visually left-most character in document coordinates.
[in]aFontNameThe 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]aFontSizeThe font size (in user space units).
[in]aTextColorThe text color.
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0.
[in]aFlagsMust be AddTextFlags.Zero.
[in]aLangLanguage identifier for aText, either an RFC 3066 language tag (example: "en-US") or an empty string. If a PDF/UA document does not specify a natural language, a language identifier is required. If a language identifier is required and aLang is an empty string, the behavior depends on flag DocumentFlags.RequireLang:
See also
addText(), addTextRect2(), addWatermark(), setDefaultDocumentLanguage(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireLang, SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigStream()
void addTextRect ( out ReturnCode  aReturnCode,
string  aText,
int  aPage,
double  aX0,
double  aY0,
double  aX1,
double  aY1,
string  aFontName,
double  aFontSize,
double  aLineSkip,
SignDocColor  aTextColor,
double  aOpacity,
DocumentHAlignment  aHAlignment,
DocumentVAlignment  aVAlignment,
AddTextRectFlags  aFlags 
)

Add text in a rectangle of a page (with line breaking).

This function behaves like addTextRect2() with an empty string for aLang.

The interpretation of CR and LF in the text depends on the value of aFlags, see enum AddTextRectFlags.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTextThe text. The interpretation of CR and LF depends on the value of aFlags. Escape sequences must not be used.
[in]aPageThe 1-based page number of the page.
[in]aX0X coordinate of lower left corner.
[in]aY0Y coordinate of lower left corner.
[in]aX1X coordinate of upper right corner.
[in]aY1Y coordinate of upper right corner.
[in]aFontNameThe 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]aFontSizeThe font size (in user space units).
[in]aLineSkipThe vertical distance between the baselines of successive lines (usually 1.2 * aFontSize).
[in]aTextColorThe text color.
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0.
[in]aHAlignmentHorizontal alignment of the text.
[in]aVAlignmentVertical alignment of the text.
[in]aFlagsFlags modifying the behavior of this function, see enum AddTextRectFlags.
See also
addText(), addTextRect2(), addWatermark(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireLang, SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigStream()
void addTextRect2 ( out ReturnCode  aReturnCode,
string  aText,
int  aPage,
double  aX0,
double  aY0,
double  aX1,
double  aY1,
string  aFontName,
double  aFontSize,
double  aLineSkip,
SignDocColor  aTextColor,
double  aOpacity,
DocumentHAlignment  aHAlignment,
DocumentVAlignment  aVAlignment,
AddTextRectFlags  aFlags,
string  aLang 
)

Add text in a rectangle of a page (with line breaking and language identifier).

The interpretation of CR and LF in the text depends on the value of aFlags, see enum AddTextRectFlags.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTextThe text. The interpretation of CR and LF depends on the value of aFlags. Escape sequences must not be used.
[in]aPageThe 1-based page number of the page.
[in]aX0X coordinate of lower left corner.
[in]aY0Y coordinate of lower left corner.
[in]aX1X coordinate of upper right corner.
[in]aY1Y coordinate of upper right corner.
[in]aFontNameThe 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]aFontSizeThe font size (in user space units).
[in]aLineSkipThe vertical distance between the baselines of successive lines (usually 1.2 * aFontSize).
[in]aTextColorThe text color.
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0.
[in]aHAlignmentHorizontal alignment of the text.
[in]aVAlignmentVertical alignment of the text.
[in]aFlagsFlags modifying the behavior of this function, see enum AddTextRectFlags.
[in]aLangLanguage identifier for aText, either an RFC 3066 language tag (example: "en-US") or an empty string. If a PDF/UA document does not specify a natural language, a language identifier is required. If a language identifier is required and aLang is an empty string, the behavior depends on flag DocumentFlags.RequireLang:
See also
addText2(), addWatermark(), setDefaultDocumentLanguage(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireLang, SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigStream()
void addWatermark ( out ReturnCode  aReturnCode,
SignDocWatermark  aInput 
)
void applyFdf ( out ReturnCode  aReturnCode,
string  aPath,
SetFieldFlags  aFlags 
)

Apply an FDF document to a PDF document.

FDF documents can be applied to PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the FDF document. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
[in]aFlagsFlags modifying the behavior of this function, see enum SetFieldFlags.
void changeAttachmentDescription ( out ReturnCode  aReturnCode,
string  aName,
string  aDescription 
)

Change the description of an attachment of the document.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
[in]aDescriptionThe new description of the attachment.
See also
addAttachmentBlob(), addAttachmentFile(), getAttachments(), removeAttachment()
CheckAttachmentResult checkAttachment ( out ReturnCode  aReturnCode,
string  aName 
)

Check the checksum of an attachment.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
Returns
The result of the check.
See also
getAttachment(), getAttachments(), getAttachmentBlob(), getAttachmentStream()
void clearAllSignatures ( out ReturnCode  aReturnCode)

Remove all signatures of the document.

This includes any certification signature, see removeDocMDP().

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
clearSignature(), clearApprovalSignatures(), removeDocMDP()
void clearApprovalSignatures ( out ReturnCode  aReturnCode)

Remove all approval signatures of the document.

Note
In TIFF documents, all signatures are approval signatures.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
clearAllSignatures(), clearSignature(), removeDocMDP()
void clearSignature ( out ReturnCode  aReturnCode,
string  aFieldName 
)

Remove a signature of the document.

For some document formats (TIFF), signatures may only be cleared in the reverse order of signing (LIFO).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFieldNameThe name of the signature field.
See also
clearAllSignatures(), clearApprovalSignatures(), getFields()
void closeDocument ( )

Close the document and the underlying file.

After closing the document, all methods but closeDocument() will fail.

double computeZoom ( out ReturnCode  aReturnCode,
SignDocRenderParameters  aParams 
)

Compute the zoom factor used for rendering.

If integer parameter "Height" or "Width" of aParams has been set, the actual factor depends on the document's page size. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the maximum width and maximum height of all selected pages will be used.

See also "Scale" of SignDocRenderParameters.setNumber().

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aParamsThe parameters such as the page number and the zoom factor.
Returns
The zoom factor.
See also
getRenderedSize(), renderPageAsImage(), renderPageAsSignDocImage(), SignDocRenderParameters.setInteger(), SignDocRenderParameters.setNumber()
void convCanvasPointToPagePoint ( out ReturnCode  aReturnCode,
Point  aPoint,
SignDocRenderParameters  aParams 
)

Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the specified 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 (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.

Suppose the specified 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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aPointThe point to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
See also
convImageRectToPageRect(), convPagePointToCanvasPoint()
Rect convImageRectToPageRect ( out ReturnCode  aReturnCode,
SignDocImageRect  aInput,
SignDocRenderParameters  aParams 
)

Convert a rectangle expressed in canvas (image) coordinates to a rectangle expressed in document coordinate system of the specified 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 (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.

Suppose the specified 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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aInputThe rectangle to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
Returns
The converted rectangle.
See also
convCanvasPointToPagePoint(), convPageRectToImageRect(), Rect.normalize()
void convPagePointToCanvasPoint ( out ReturnCode  aReturnCode,
Point  aPoint,
SignDocRenderParameters  aParams 
)

Convert a point expressed in document coordinate system of the specified 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 (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.

Suppose the specified 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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aPointThe point to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
See also
convCanvasPointToPagePoint(), convPageRectToImageRect()
SignDocImageRect convPageRectToImageRect ( out ReturnCode  aReturnCode,
Rect  aInput,
SignDocRenderParameters  aParams 
)

Convert a rectangle expressed in document coordinate system of the specified page to a rectangle 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 (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.

Suppose the specified 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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aInputThe rectangle to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
Returns
The converted rectangle.
See also
convImageRectToPageRect(), convPagePointToCanvasPoint(), SignDocImageRect.normalize()
byte [] copyAsSignedToMemory ( out ReturnCode  aReturnCode,
string  aFieldName 
)

Copy the document to a blob for viewing the document "as signed".

This function copies to a blob 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 copyToMemory(). However, for some document formats, this function may require signatures to be valid.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFieldNameThe name of the signature field.
Returns
A blob containing the copied document.
See also
copyAsSignedToStream(), copyToMemory(), SignDocDocumentLoader.loadFromMemory()
void copyAsSignedToStream ( out ReturnCode  aReturnCode,
string  aFieldName,
Stream  aStream 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFieldNameThe name of the signature field.
[in]aStreamThe document will be copied to this stream.
See also
copyAsSignedToMemory(), copyToStream(), SignDocDocumentLoader.loadFromMemory()
byte [] copyToMemory ( out ReturnCode  aReturnCode,
CopyToStreamFlags  aFlags 
)

Copy the document's current status or backing file or backing blob to a blob.

If aIncludeUnsavedChanges is false, this function will copy to a blob 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 blob.

If aIncludeUnsavedChanges is true, unsaved changes made to the in-memory copy of the document will be included (as incremental update for PDF documents) in the blob.

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 blob if CopyToStreamFlags.Unsaved is set in aFlags).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsFlags modifying the behavior of this function, see enum CopyToStreamFlags.
Returns
A blob containing the copied document.
See also
copyAsSignedToMemory(), copyToStream(), saveToFile(), saveToMemory(), saveToStream(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
void copyToStream ( out ReturnCode  aReturnCode,
Stream  aStream,
CopyToStreamFlags  aFlags 
)

Copy the document's current status or backing file or backing blob to a stream.

If aIncludeUnsavedChanges is false, 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 aIncludeUnsavedChanges is true, 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 CopyToStreamFlags.Unsaved is set in aFlags).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aStreamThe document will be copied to this stream.
[in]aFlagsFlags modifying the behavior of this function, see enum CopyToStreamFlags.
See also
copyAsSignedToStream(), copyToMemory(), saveToFile(), saveToMemory(), saveToStream(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
SignDocAnnotation createFreeTextAnnotation ( Point  aLowerLeft,
Point  aUpperRight 
)

Create a text annotation.

See SignDocAnnotation for details.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[in]aLowerLeftcoordinates of lower left corner.
[in]aUpperRightcoordinates of upper right corner.
Returns
The new annotation object.
See also
addAnnotation()
SignDocAnnotation createFreeTextAnnotation ( double  aX0,
double  aY0,
double  aX1,
double  aY1 
)

Create a text annotation.

See SignDocAnnotation for details.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[in]aX0X coordinate of lower left corner.
[in]aY0Y coordinate of lower left corner.
[in]aX1X coordinate of upper right corner.
[in]aY1Y coordinate of upper right corner.
Returns
The new annotation object.
See also
addAnnotation()
SignDocAnnotation createLineAnnotation ( Point  aStart,
Point  aEnd 
)

Create a line annotation.

See SignDocAnnotation for details.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[in]aStartStart point.
[in]aEndEnd point.
Returns
The new annotation object.
See also
addAnnotation()
SignDocAnnotation createLineAnnotation ( double  aStartX,
double  aStartY,
double  aEndX,
double  aEndY 
)

Create a line annotation.

See SignDocAnnotation for details.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[in]aStartXX coordinate of start point.
[in]aStartYY coordinate of start point.
[in]aEndXX coordinate of end point.
[in]aEndYY coordinate of end point.
Returns
The new annotation object.
See also
addAnnotation()
SignDocAnnotation createScribbleAnnotation ( )

Create a scribble annotation.

See SignDocAnnotation for details.

Returns
The new annotation object.
See also
addAnnotation(), SignDocAnnotation.addPoint(), SignDocAnnotation.newStroke()
SignDocSignatureParameters createSignatureParameters ( out ReturnCode  aReturnCode,
string  aFieldName,
string  aProfile 
)

Create a SignDocSignatureParameters object for signing a signature field.

Each SignDocSignatureParameters object should be used for at most one signature.

The following profiles are available and documented:

ProfileDocument TypesDescription
"" PDF, TIFF Image above Signer and SignTime
"image" PDF, TIFF Image only

For TIFF documents, "" produces the same output as "image".

Profile "" is defined by this template:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE SignatureTemplate SYSTEM "SignatureTemplate.dtd">
<SignatureTemplate
    text-halignment="center"
    text-valignment="bottom"
    image-halignment="center"
    image-valignment="top"
    image-transparency="brightest"
    text-position="below"
    font-size="0.1 h"
    text-hmargin="0.1 h"
    image-margin="1">
  <Line item="Signer"/>
  <Line item="SignTime"/>
</SignatureTemplate>

Profile "image" is defined by this template:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE SignatureTemplate SYSTEM "SignatureTemplate.dtd">
<SignatureTemplate
    text-halignment="center"
    text-valignment="center"
    image-halignment="center"
    image-valignment="center"
    image-transparency="brightest"
    text-position="overlay"
    font-size="0.1 h"
    text-hmargin="0.1 h"
    image-margin="1">
</SignatureTemplate>
Parameters
[in]aFieldNameThe name of the signature field.
[in]aProfileThe profile name. Some document types and signature fields support different sets of default parameters. The default profile, "", is supported for all signature fields.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The new parameters object.
See also
addSignature(), createSignatureParametersForTimeStamp(), getProfiles()
SignDocSignatureParameters createSignatureParametersForTimeStamp ( out ReturnCode  aReturnCode)

Create a SignDocSignatureParameters object for adding a document time stamp.

Each SignDocSignatureParameters object should be used for at most one signature.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The new parameters object.
See also
addSignature(), createSignatureParameters()
SignDocTextIterator createTextIterator ( out ReturnCode  aReturnCode,
int  aFirstPage,
int  aLastPage,
CreateTextIteratorFlags  aFlags 
)

Create an iterator that visits all the text of a range of pages.

Text will be returned in the sequence encountered when reading the content streams of the document sequentially.

This function is implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFirstPage1-based number of first page to be visited.
[in]aLastPage1-based number of last page to be visited or 0 for all pages to the end of the document.
[in]aFlagsFlags modifying the behavior of this function, must be CreateTextIteratorFlags.Zero.
Returns
The new text iterator object.
See also
findText()
void exportFields ( out ReturnCode  aReturnCode,
Stream  aStream,
ExportFlags  aFlags 
)

Export all fields as XML to a stream.

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: DocumentFlags.AmbiguousButtonValueEmpty.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aStreamThe fields will be saved to this stream.
[in]aFlagsFlags modifying the behavior of this function, See enum ExportFlags.
See also
exportFieldsToMemory(), getFields(), setField()
byte [] exportFieldsToMemory ( out ReturnCode  aReturnCode,
ExportFlags  aFlags 
)

Export all fields as XML to a blob.

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: DocumentFlags.AmbiguousButtonValueEmpty.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsFlags modifying the behavior of this function, See enum ExportFlags.
Returns
The XML document.
See also
exportFieldsToMemory(), getFields(), setField()
void exportProperties ( out ReturnCode  aReturnCode,
string  aCollection,
Stream  aStream,
ExportFlags  aFlags 
)

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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties(). If the string is empty, all properties of the "public" and "encrypted" collections will be exported.
[in]aStreamThe properties will be saved to this stream.
[in]aFlagsFlags modifying the behavior of this function, See enum ExportFlags.
See also
exportPropertiesToMemory(), importProperties(), importPropertiesFromMemory()
byte [] exportPropertiesToMemory ( out ReturnCode  aReturnCode,
string  aCollection,
ExportFlags  aFlags 
)

Export properties as XML to a blob.

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).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties(). If the string is empty, all properties of the "public" and "encrypted" collections will be exported.
[in]aFlagsFlags modifying the behavior of this function, See enum ExportFlags.
Returns
The XML document.
See also
exportPropertiesToMemory(), importProperties(), importPropertiesFromMemory()
SignDocFindTextOccurrence [] findText ( out ReturnCode  aReturnCode,
int  aFirstPage,
int  aLastPage,
string  aText,
FindTextFlags  aFlags 
)

Find text.

The text of the document will be scanned in the sequence encountered when reading the content streams of the document sequentially.

This function is implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFirstPage1-based number of first page to be searched.
[in]aLastPage1-based number of last page to be searched or 0 to search to the end of the document.
[in]aTextText to be searched for. Multiple successive spaces are treated as single space (and may be ignored subject to aFlags).
[in]aFlagsFlags modifying the behavior of this function, see enum FindTextFlags.
Returns
Information about the found text.
Note
The WinRT component returns null instead of an empty array.
See also
createTextIterator()
void flattenAnnotations ( out ReturnCode  aReturnCode,
int  aFirstPage,
int  aLastPage,
FlattenAnnotationsFlags  aFlags 
)

Flatten all annotations of the document or of a range of pages.

Flattening an annotation of a PDF document makes its appearance part of the page and removes the selected annotation or all annotations. This function selects all non-widget annotations on the specified pages, ie, it does not flatten fields.

Flattening annotations breaks existing signatures. If you are flattening annotations only for printing with PDF components that don't support annotations, make a copy of the document, pass

SignDocDocument.ShootInFootFlags.AllowBreakingPermissions | SignDocDocument.ShootInFootFlags.AllowBreakingSignatures

to setShootInFoot(), flatten the annotations, print the document, and throw it away.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFirstPage1-based number of first page.
[in]aLastPage1-based number of last page or 0 to process all pages to the end of the document.
[in]aFlagsFlags modifying the behavior of this function, see FlattenAnnotationsFlags.
See also
flattenFields(), removeAnnotation()
void flattenField ( out ReturnCode  aReturnCode,
string  aName,
int  aWidget 
)

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 uint 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

SignDocDocument.ShootInFootFlags.AllowBreakingPermissions | SignDocDocument.ShootInFootFlags.AllowBreakingSignatures

to setShootInFoot(), flatten the fields, print the document, and throw it away.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe fully-qualified name of the field.
[in]aWidgetThe widget index to flatten only one widget or -1 to flatten all widgets.
See also
flattenFields(), removeField()
void flattenFields ( out ReturnCode  aReturnCode,
int  aFirstPage,
int  aLastPage,
FlattenFieldsFlags  aFlags 
)

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 uint 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

SignDocDocument.ShootInFootFlags.AllowBreakingPermissions | SignDocDocument.ShootInFootFlags.AllowBreakingSignatures

to setShootInFoot(), flatten the fields, print the document, and throw it away.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFirstPage1-based number of first page.
[in]aLastPage1-based number of last page or 0 to process all pages to the end of the document.
[in]aFlagsFlags modifying the behavior of this function, see FlattenFieldsFlags. If this value is 0, signature fields and hidden/invisible widgets will not be flattened.
See also
flattenAnnotations(), flattenField(), removeField()
SignDocAnnotation getAnnotation ( out ReturnCode  aReturnCode,
int  aPage,
string  aName 
)

Get a named annotation of a page.

All setters will fail for the returned object.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
[in]aNameThe name of the annotation.
Returns
The annotation object.
See also
getAnnotations()
string [] getAnnotations ( out ReturnCode  aReturnCode,
int  aPage 
)

Get a list of all named annotations of a page.

Unnamed annotations are ignored by this function.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The list of annotation names. The order is currently unspecified, a future implementation may return the annotations in tab order.
Note
The WinRT component returns null instead of an empty array.
See also
addAnnotation(), getAnnotation(), removeAnnotation(), SignDocAnnotation.setName()
SignDocAttachment getAttachment ( out ReturnCode  aReturnCode,
string  aName 
)

Get information about an attachment.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
Returns
Information about the attachment.
See also
checkAttachment(), getAttachments(), getAttachmentBlob(), getAttachmentStream()
byte [] getAttachmentBlob ( out ReturnCode  aReturnCode,
string  aName 
)

Get an attachment as blob.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
Returns
The attachment's data.
Note
The WinRT component returns null instead of an empty array.
See also
checkAttachment(), getAttachments(), getAttachmentStream()
string [] getAttachments ( out ReturnCode  aReturnCode)

Get a list of all attachments of the document.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The names of the document's attachments. Use getAttachment() to get information for a single attachment.
Note
The WinRT component returns null instead of an empty array.
See also
checkAttachment(), getAttachment(), getAttachmentBlob(), getAttachmentStream()
InputStream getAttachmentStream ( out ReturnCode  aReturnCode,
string  aName 
)

Get an InputStream for an attachment.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
Returns
An InputStream object for the attachment's data.
See also
checkAttachment(), getAttachments(), getAttachmentBlob()
SigningMethodFlags getAvailableMethods ( )

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.

Returns
A bitset of available signing methods.
See also
SignDocSignatureParameters.getAvailableMethods()
int getBitsPerPixel ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the number of bits per pixel (TIFF only).

Different pages of the document may have different numbers of bits per pixel.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The number of bits per pixel of the page (1, 8, 24, or 32) or 0 (for PDF documents).
bool? getBooleanProperty ( string  aCollection,
string  aName 
)

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.

Parameters
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
Returns
The value of the property.
See also
getProperties()
double getConversionFactorX ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the horizontal conversion factor for a page.

Different pages of the document may have different conversion factors. For TIFF documents, this function returns the same value as getResolutionX(). For PDF documents, this function now always returns 72 as UserUnit is taken into account automatically.

See Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
Divide horizontal coordinates by the returned number to convert document coordinates to inches. The return value will be 0.0 if the factor is not available.
See also
getConversionFactorY(), getResolutionX()
double getConversionFactorY ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the vertical conversion factor for a page.

Different pages of the document may have different conversion factors. For TIFF documents, this function returns the same value as getResolutionX(). For PDF documents, this function now always returns 72 as UserUnit is taken into account automatically.

See Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
Divide vertical coordinates by the returned number to convert document coordinates to inches. The return value will be 0.0 if the factor is not available.
See also
getConversionFactorX(), getResolutionY()
int getDocMDP ( )

Get the DocMDP P value of the document's certification signature.

The DocMDP P value of the certification signature specifies what modifications to the document are allowed.

This function does not verify the certification signature.

Returns
-1 if there is no certification signature, 1 if no modifications are allowed, 2 if only filling in forms, instantiating page templates, and signing are permitted, 3 if only filling in forms, instantiating page templates, signing, creating annotations, deleting annotations, and modifying annotations are permitted. For TIFF documents, this function always returns -1.
See also
getLockMDP()
string getDocumentLanguage ( )

Get the document's natural language.

That language applies to all text unless overridden locally.

Returns
The natural language of the document as RFC 3066 language tag. Example: "en-US". If the document does not specify a natural language, an empty string will be returned.
See also
setDocumentLanguage(), DocumentFlags.RequireAlternateFieldName, DocumentFlags.RequireLang
string getErrorMessage ( )

Get an error message for the last function call.

Returns
A string describing the reason for the failure of the last function call. The string is empty if the last call succeeded.
SignDocField getField ( out ReturnCode  aReturnCode,
string  aName 
)

Get an interactive field by name.

There is a setFlags() flag modifying the behavior of this function: DocumentFlags.AmbiguousButtonValueEmpty.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe fully-qualified name of the field.
Returns
The selected field.
See also
getFields(), setField()
SignDocField [] getFields ( out ReturnCode  aReturnCode,
FieldTypeFlags  aTypes 
)

Get all interactive fields of the specified types.

There is a setFlags() flag modifying the behavior of this function: DocumentFlags.AmbiguousButtonValueEmpty.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTypes0 to get fields of all types. Otherwise, a bitset selecting the field types to be included.
Returns
An array containing the selected fields in the order in which they have been defined.
Note
The WinRT component returns null instead of an empty array.
See also
exportFields(), exportFieldsToMemory(), getField(), getFieldsOfPage()
SignDocField [] getFieldsOfPage ( out ReturnCode  aReturnCode,
int  aPage,
FieldTypeFlags  aTypes 
)

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: DocumentFlags.AmbiguousButtonValueEmpty.

Note
Structure order (S) is not yet supported. If the page specifies structure order, the fields will be returned in widget order.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe 1-based page number.
[in]aTypes0 to get fields of all types. Otherwise, a bitset selecting the field types to be included.
Returns
An array containing the selected fields 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.
Note
The WinRT component returns null instead of an empty array.
See also
exportFields(), exportFieldsToMemory(), getField(), getFields()
DocumentFlags getFlags ( )

Get the flags set by setFlags().

Returns
The flags currently in force.
See also
setFlags()
int? getIntegerProperty ( string  aCollection,
string  aName 
)

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.

Parameters
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
Returns
The value of the property.
See also
getProperties()
string getLastTimestamp ( out ReturnCode  aReturnCode)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
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).
See also
addSignature(), getSignatureString(), SignDocSignatureParameters.setString()
int getLockMDP ( )

Get the lowest lock MDP value of the signed signature fields.

The lock MDP value specifies what modifications to the document are allowed.

This function does not verify any signature.

Returns
-1 if there is no signature field with lock MDP value, 1 if no modifications are allowed, 2 if only filling in forms, instantiating page templates, and signing are permitted, 3 if only filling in forms, instantiating page templates, signing, creating annotations, deleting annotations, and modifying annotations are permitted. For TIFF documents, this function always returns -1.
See also
getDocMDP()
int getPageCount ( )

Get the number of pages.

Returns
The number of pages.
See also
getPageLabel()
double getPageHeight ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the height of a page.

Different pages of the document may have different sizes.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The page height in document coordinates.
See also
getConversionFactorY()
string getPageLabel ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the page label for a page number.

For TIFF documents, aPage will be converted to a decimal number.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The page label.
See also
getPageCount()
double getPageWidth ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the width of a page.

Different pages of the document may have different sizes.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The page width in document coordinates.
See also
getConversionFactorX()
string getPathname ( out ReturnCode  aReturnCode)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The pathname or "".
string [] getProfiles ( out ReturnCode  aReturnCode,
string  aFieldName 
)

Get a list of profiles for a signature field.

Parameters
[in]aFieldNameThe name of the signature field.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
An array containing the names of all profiles supported by the signature field, excluding the default profile "" which is always available.
See also
createSignatureParameters()
Note
The WinRT component returns null instead of an empty array.
SignDocProperty [] getProperties ( out ReturnCode  aReturnCode,
string  aCollection 
)

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 two collections of SignDoc document properties:

  • "encrypted" Encrypted properties. Names and values are symmetrically encrypted.
  • "public" Public properties. Document viewer applications may be able to display or let the user modify these properties.
  • "pdfa" PDF/A properties (PDF documents only):
    • part (PDF/A version identifier: 1, 2, or 3)
    • amd (optional PDF/A amendment identifier)
    • conformance (PDF/A conformance level: A, B, or U)
    All properties in this collection have string values, the property names are case-sensitive. If the "part" property is present, the document claims to be conforming to PDF/A. Your application may change its behavior when dealing with PDF/A documents. For instance, it might want to avoid transparency.
  • "pdfua" PDF/UA properties (PDF documents only):
    • part (PDF/UA version identifier: 1)
    • amd (optional PDF/UA amendment identifier)
    • corr (optional PDF/UA corrigenda identifier)
    All properties in this collection have string values, the property names are case-sensitive. If the "part" property is present, the document claims to be conforming to PDF/UA. Your application may change its behavior when dealing with PDF/UA documents.

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 exception SignDocWrongCollectionException. 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" and "pdfua" collections are read-only and a property name existing in those collections 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.

Parameters
[in]aCollectionThe name of the collection, see above.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The properties.
Note
The WinRT component returns null instead of an empty array.
SignDocRenderOutput getRenderedSize ( out ReturnCode  aReturnCode,
SignDocRenderParameters  aParams 
)

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 (integer parameters "FirstPage" and "LastPage" of aParams), the maximum width and maximum height of all selected pages will be used.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aParamsParameters such as the page number.
Returns
The width and height of the image that would be computed by renderPageAsImage() and renderPageAsSignDocImage() with aClipRect being null.
See also
renderPageAsImage(), renderPageAsSignDocImage()
SaveFlags getRequiredSaveToFileFlags ( out ReturnCode  aReturnCode)

Get all flags currently required for saveToFile().

This function currently returns SaveFlags.Incremental (saving the document non-incrementally would destroy existing signatures) or 0 (the document may be saved non-incrementally).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The flags.
See also
getSaveToFileFlags(), getSaveToStreamFlags(), saveToFile()
double getResolutionX ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the horizontal resolution of a page.

Different pages of the document may have different resolutions. Use getConversionFactorX() to get the factor for converting document coordinates to real world coordinates.

See Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The horizontal resolution in DPI. The value will be 0.0 if the resolution is not available.
See also
getConversionFactorX(), getResolutionY()
double getResolutionY ( out ReturnCode  aReturnCode,
int  aPage 
)

Get the vertical resolution of a page.

Different pages of the document may have different resolutions. Use getConversionFactorY() to get the factor for converting document coordinates to real world coordinates.

See Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
Returns
The vertical resolution in DPI. The value will be 0.0 if the resolution is not available.
See also
getConversionFactorY(), getResolutionX()
SaveFlags getSaveToFileFlags ( out ReturnCode  aReturnCode)

Get all flags currently valid for saveToFile().

Note that SaveFlags.Incremental cannot be used together with SaveFlags.Linearized even if all these flags are returned by this function. SaveFlags.PDFAButtons is returned only if the document claims PDF/A-1 conformance.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The flags.
See also
getRequiredSaveToFileFlags(), getSaveToStreamFlags(), saveToFile()
SaveFlags getSaveToStreamFlags ( out ReturnCode  aReturnCode)

Get all flags currently valid for saveToStream() and saveToMemory().

Note that SaveFlags.Incremental cannot be used together with SaveFlags.Linearized even if all these flags are returned by this function. SaveFlags.PDFAButtons is returned only if the document claims PDF/A-1 conformance.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The flags.
See also
getSaveToFileFlags(), saveToMemory(), saveToStream()
ShootInFootFlags getShootInFoot ( )

Get the flags set by setShootInFoot().

Returns
The flags currently in force.
See also
setShootInFoot()
SignDocSignature getSignature ( out ReturnCode  aReturnCode,
int  aIndex 
)

Get a signature of the document.

By passing values for aIndex from 0 up to getSignatureCount()-1, the history of changes to the document can be obtained. Exception: If clearSignature() has been called for a TIFF document, the order of signatures is indeterminate.

Parameters
[in]aIndexThe index of the signature, 0 for the first signature applied to the document, getSignatureCount()-1 for the newest signature.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
A new SignDocSignature object.
See also
getSignatureCount(), verifySignature(), verifySignature2()
int getSignatureCount ( )

Get the number of signatures that can be retrieved with getSignature().

Returns
The number of signatures, possibly including removed signatures.
See also
getSignature()
string getStringProperty ( string  aCollection,
string  aName 
)

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.

Parameters
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
Returns
The value of the property.
See also
getProperties()
SignDocTextFieldAttributes getTextFieldAttributes ( out ReturnCode  aReturnCode)

Get the document's default text field attributes.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The text field attributes.
See also
getField(), setTextFieldAttributes(), SignDocField.getTextFieldAttributes()
DocumentType getType ( )

Get the type of the document.

Returns
The document type.
void importPageFromImageBlob ( out ReturnCode  aReturnCode,
int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags 
)

Import a page from a blob containing an image.

This function behaves like importPageFromImageBlob2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use importPageFromImageBlob2() with a meaningful description of the image.

This function is currently implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the new page. The page will be appended if this value is 0.
[in]aDataThe blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aWidthPage 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]aHeightPage 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]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
See also
addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob2(), importPageFromImageFile(), importPageFromImageFile2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void importPageFromImageBlob2 ( out ReturnCode  aReturnCode,
int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags,
string  aDescription,
string  aLang 
)

Import a page from a blob containing an image (with alternate description).

This function is currently implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the new page. The page will be appended if this value is 0.
[in]aDataThe blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aWidthPage 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]aHeightPage 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]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
[in]aDescriptionAlternate description for the image. If this value is an empty string, aLang will be ignored. If this value is an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used.
[in]aLangLanguage identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US".
See also
addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageFile(), importPageFromImageFile2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void importPageFromImageFile ( out ReturnCode  aReturnCode,
int  aTargetPage,
string  aPath,
double  aZoom,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags 
)

Import a page from a file containing an image.

This function behaves like importPageFromImageFile2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use importPageFromImageFile2() with a meaningful description of the image.

This function is currently implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the new page. The page will be appended if this value is 0.
[in]aPathThe pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aWidthPage 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]aHeightPage 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]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
See also
addImageFromFile(), addImageFromFile2(), importPageFromImageBlob(), importPageFromImageBlob2(), importPageFromImageFile2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void importPageFromImageFile2 ( out ReturnCode  aReturnCode,
int  aTargetPage,
string  aPath,
double  aZoom,
double  aWidth,
double  aHeight,
ImportImageFlags  aFlags,
string  aDescription,
string  aLang 
)

Import a page from a file containing an image (with alternate description).

This function is currently implemented for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the new page. The page will be appended if this value is 0.
[in]aPathThe pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP.
[in]aZoomZoom 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]aWidthPage 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]aHeightPage 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]aFlagsFlags modifying the behavior of this function, See enum ImportImageFlags. ImportImageFlags.KeepAspectRatio is not needed if aZoom is non-zero.
[in]aDescriptionAlternate description for the image. If this value is an empty string, aLang will be ignored. If this value is an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used.
[in]aLangLanguage identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US".
See also
addImageFromFile(), addImageFromFile2(), importPageFromImageBlob(), importPageFromImageBlob2(), importPageFromImageFile2(), isTaggedPDF(), DocumentFlags.FailForBrokenTargetStructure
void importPages ( out ReturnCode  aReturnCode,
int  aTargetPage,
SignDocDocument  aSource,
int  aSourcePage,
int  aPageCount,
ImportPagesFlags  aFlags 
)

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.

Unless flag ShootInFootFlags.AllowBreakingTaggedPDF is set, this function may fail for some values of aTargetPage as the target structure may not be suitable for insertion of pages between certain pages. Appending pages after the last page should always work.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTargetPageThe 1-based number of the page before which to insert the copied pages. The pages will be appended if this value is 0.
[in]aSourceThe document from which to copy the pages. aSource can be this.
[in]aSourcePageThe 1-based number of the first page (in the source document) to be copied.
[in]aPageCountThe number of pages to be copied. All pages of aSource starting with aSourcePage will be copied if this value is 0.
[in]aFlagsMust be ImportPagesFlags.Zero.
See also
isTaggedPDF(), setFlags(), DocumentFlags.FailForBrokenTargetStructure, ShootInFootFlags.AllowBreakingTaggedPDF
void importProperties ( out ReturnCode  aReturnCode,
string  aCollection,
InputStream  aStream,
ImportFlags  aFlags 
)

Import properties from XML (reading a stresm).

The input must conform to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe 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]aStreamThe properties will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aFlagsFlags modifying the behavior of this function, see enum ImportFlags.
See also
exportProperties(), exportPropertiesToMemory(), importPropertiesFromMemory()
void importPropertiesFromMemory ( out ReturnCode  aReturnCode,
string  aCollection,
byte[]  aBlob,
ImportFlags  aFlags 
)

Import properties from XML (reading a blob).

The input must conform to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe 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]aBlobThe properties will be read from this blob.
[in]aFlagsFlags modifying the behavior of this function, see enum ImportFlags.
See also
exportProperties(), exportPropertiesToMemory(), importProperties()
bool isModified ( out ReturnCode  aReturnCode)

Check if the document has unsaved changes.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
true if the document has unsaved changes, false if the document does not have unsaved changes.
bool isTaggedPDF ( out ReturnCode  aReturnCode)

Check if the document is a Tagged PDF document.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
true if the document is a Tagged PDF document, false if the document is not a Tagged PDF document.
void removeAnnotation ( out ReturnCode  aReturnCode,
int  aPage,
string  aName 
)

Remove an annotation identified by name.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPageThe page number (1 for the first page).
[in]aNameThe name of the annotation, must not be empty.
See also
addAnnotation(), flattenAnnotations(), getAnnotations(), SignDocAnnotation.setName()
void removeAttachment ( out ReturnCode  aReturnCode,
string  aName 
)

Remove an attachment from the document.

Attachments are supported for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the attachment.
See also
addAttachmentBlob(), addAttachmentFile(), getAttachments()
void removeDocMDP ( out ReturnCode  aReturnCode)

Remove any certification signature.

This function does nothing for TIFF documents as TIFF documents do not have certification signatures.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
clearAllSignatures(), getDocMDP(), removePDFA(), removePDFUA(), removePermissions(), setShootInFoot()
void removeField ( out ReturnCode  aReturnCode,
string  aName 
)

Remove a field.

Removing a field of a TIFF document will invalidate all signatures.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe fully-qualified name of the field.
See also
addField(), flattenField(), getFields()
void removeLogicalStructure ( out ReturnCode  aReturnCode,
RemoveFlags  aFlags 
)

Remove the logical structure.

This function is available for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsMust be RemoveFlags.Zero.
See also
isTaggedPDF()
void removePages ( out ReturnCode  aReturnCode,
ConstArray(int)  aPages,
KeepOrRemove  aMode 
)

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 FieldFlags.SinglePage flag set can survive removal of pages.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPagesAn array of one-based page numbers. The order does not matter, neither does the number of occurences of a page number.
[in]aModeTell this function whether to keep or to remove the pages specified by aPages.
void removePDFA ( out ReturnCode  aReturnCode,
RemoveFlags  aFlags 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsMust be RemoveFlags.Zero.
See also
removePDFUA(), removePermissions()
void removePDFUA ( out ReturnCode  aReturnCode,
RemoveFlags  aFlags 
)

Remove PDF/UA conformance.

Some operations on PDF documents (such as using standard fonts) are not allowed in PDF/UA documents. This function turns a PDF/UA document into a plain document, enabling those operations.

This function is available for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsMust be RemoveFlags.Zero.
See also
removePDFA(), removePermissions()
void removePermissions ( out ReturnCode  aReturnCode,
RemoveFlags  aFlags 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsMust be RemoveFlags.Zero.
See also
removePDFA(), removePDFUA(), setShootInFoot()
void removeProperty ( out ReturnCode  aReturnCode,
string  aCollection,
string  aName 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
See also
getProperties(), setStringProperty()
void removeXFA ( out ReturnCode  aReturnCode,
RemoveFlags  aFlags 
)

Remove XFA (XML Forms Architecture) content.

SignDoc SDK does not support XFA (XML Forms Architecture) and therefore addSignature(), addField(), applyFdf(), and setField() remove XFA from the document to avoid descrepancies between "classic" form fields and XFA. This function is available for PDF documents only.

You can also remove XFA content by calling this function. It will fail if the document prohibits removal of XFA (removing XFA from signed documents breaks signatures).

This function is available for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsMust be RemoveFlags.Zero.
byte [] renderPageAsImage ( out ReturnCode  aReturnCode,
SignDocRenderOutput  aOutput,
SignDocRenderParameters  aRenderParameters,
SignDocVerificationParameters  aVerificationParameters,
Rect  aClipRect 
)

Render the selected page (or pages) as image.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aOutputThe image size will be stored here.
[in]aRenderParametersParameters such as the page number.
[in]aVerificationParametersParameters 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]aClipRectThe rectangle to be rendered (using document coordinates, see Coordinate Systems) or null to render the complete page.
Returns
The image as blob.
See also
computeZoom(), getRenderedSize()
SignDocImage renderPageAsSignDocImage ( out ReturnCode  aReturnCode,
SignDocRenderOutput  aOutput,
SignDocRenderParameters  aRenderParameters,
SignDocVerificationParameters  aVerificationParameters,
Rect  aClipRect 
)

Render the selected page (or pages) as SignDocImage object.

Only a single page can be rendered.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aOutputThe image size will be stored here.
[in]aRenderParametersParameters such as the page number.
[in]aVerificationParametersParameters 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]aClipRectThe rectangle to be rendered (using document coordinates, see Coordinate Systems) or null to render the complete page.
Returns
The SignDocImage object containing the rendered page.
See also
computeZoom(), getRenderedSize()
void saveToFile ( out ReturnCode  aReturnCode,
string  aPath,
SaveFlags  aFlags 
)

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 SaveFlags.Incremental will fail unless SaveFlags.AutoIncremental is also set. See also getRequiredSaveToFileFlags().

The file will remain open until the document is saved again or the SignDocDocument object is closed or destroyed.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the file to be created or overwritten. Pass an empty string 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]aFlagsSet 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. Which flags are required depends on the document state. Call getRequiredSaveToFileFlags() to get the flags that are required.
See also
copyToMemory(), copyToStream(), getRequiredSaveToFileFlags(), getSaveToFileFlags(), saveToMemory(), saveToStream(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
byte [] saveToMemory ( out ReturnCode  aReturnCode,
SaveFlags  aFlags 
)

Save the document to a blob.

This function may have side effects on the document such as marking it as not modified which may render SaveFlags.Incremental useless for the next saveToFile() call unless the document is changed between those two calls.

After calling this function, the document will be backed by memory.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsSet 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.
Returns
A blob containing the saved document.
See also
copyToMemory(), getSaveToStreamFlags(), saveToFile(), saveToStream(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
void saveToStream ( out ReturnCode  aReturnCode,
Stream  aStream,
SaveFlags  aFlags 
)

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 SaveFlags.Incremental useless for the next saveToFile() call unless the document is changed between those two calls.

After calling this function, the document will be backed by memory.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aStreamThe document will be saved to this stream.
[in]aFlagsSet 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.
See also
copyToStream(), getSaveToStreamFlags(), saveToFile(), saveToMemory(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
void setBooleanProperty ( out ReturnCode  aReturnCode,
string  aCollection,
string  aName,
bool  aValue 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
[in]aValueThe new value of the property.
See also
getProperties(), removeProperty(), setIntegerProperty(), setStringProperty(), addSignature()
void setCompatibility ( out ReturnCode  aReturnCode,
int  aMajor,
int  aMinor 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aMajorMajor version number.
[in]aMinorMinor version number.
void setCompressionLevel ( out ReturnCode  aReturnCode,
int  aLevel 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aLevelThe 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.
void setDefaultDocumentLanguage ( out ReturnCode  aReturnCode,
string  aLang 
)

Set the language identifier to be used if a language identifier is required but the document doesn't provide one.

If this function is not called, "en" will be used.

This function is available for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aLangAn RFC 3066 language tag. Must not be an empty string. Example: "en-US".
See also
getDocumentLanguage(), setDocumentLanguage(), DocumentFlags.RequireAlternateFieldName, DocumentFlags.RequireLang
void setDocumentLanguage ( out ReturnCode  aReturnCode,
string  aLang 
)

Set the document's natural language.

That language applies to all text unless overridden locally.

This function is available for PDF documents only.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aLangThe natural language for the document (an RFC 3066 language tag). Must not be an empty string. Example: "en-US".
See also
getDocumentLanguage(), setDefaultDocumentLanguage(), DocumentFlags.RequireAlternateFieldName, DocumentFlags.RequireLang
void setField ( out ReturnCode  aReturnCode,
SignDocField  aField,
SetFieldFlags  aFlags 
)

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().

Applications should not call setField() for fields that are locked, ie, have FieldFlags.ReadOnly set in the return value of SignDocField.getFlags(). However, setField() does not fail in that case.

The coordinates of the field are not changed unless SetFieldFlags.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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aFieldThe 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]aFlagsSet of flags (of enum SetFieldFlags, combined with `|') modifying the behavior of this function. Pass 0 for no flags.
See also
addField(), getFields(), removeField(), DocumentFlags.FailForBrokenTargetStructure, DocumentFlags.RequireAlternateFieldName
void setFlags ( out ReturnCode  aReturnCode,
DocumentFlags  aFlags 
)

Set flags modifying the behavior of various functions.

The default is value is 0.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsNew set of flags, see enum DocumentFlags.
See also
getFlags(), setShootInFoot()
void setIntegerProperty ( out ReturnCode  aReturnCode,
string  aCollection,
string  aName,
int  aValue 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
[in]aValueThe new value of the property.
See also
getProperties(), removeProperty(), setBooleanProperty(), setStringProperty(), addSignature()
void setShootInFoot ( out ReturnCode  aReturnCode,
ShootInFootFlags  aFlags 
)

Disable safety checks.

The default value, 0, makes operations fail which would invalidate existing signatures (signature fields) or signatures granting permissions.

Note
If you set any flags you risk shooting yourself in the foot.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsNew set of flags, see enum ShootInFootFlags.
See also
getShootInFoot(), removePermissions(), setFlags(), SignDocField.getDocMDP()
void setStringProperty ( out ReturnCode  aReturnCode,
string  aCollection,
string  aName,
string  aValue 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
[in]aValueThe new value of the property.
See also
getProperties(), removeProperty(), setBooleanProperty(), setIntegerProperty(), addSignature()
void setTextFieldAttributes ( out ReturnCode  aReturnCode,
SignDocTextFieldAttributes  aData 
)

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.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in,out]aDataThe new default text field attributes. The font resource name will be updated.
See also
addField(), getTextFieldAttributes(), SignDocField.setTextFieldAttributes()
static string [] splitEscapeSequences ( string  aInput)
static

Split a string obtained from a PDF text string into escape sequences and text segments.

You don't need to call this function unless flag DocumentFlags.KeepEscapeSequences is set.

Parameters
[in]aInputThe input string.
Returns
The escape sequences and text segments. The escape characters are not removed from escape sequences.
Note
The WinRT component returns null instead of an empty array.
See also
withoutEscapeSequence(), DocumentFlags.KeepEscapeSequences
int updateDSS ( out ReturnCode  aReturnCode,
SignDocVerificationParameters  aParameters,
UpdateDSSFlags  aFlags 
)

Update the DSS for any eligible signatures of the document.

This function is available for PDF documents only.

To extend the validity of the signatures in a PDF document (long term validity LTV), call this function, save the document incrementally, and add a document time stamp.

If the document already has a document time stamp, this function adds information for the latest document time stamp to the DSS. If the document does not have a document time stamp, this function adds information for all eligible signature fields to the DSS.

This function fails if verification fails for any of the signatures.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aParametersVerification parameters or null for default parameters.
[in]aFlagsFlags modifying the behavior of this function, see UpdateDSSFlags.Simulate and UpdateDSSFlags.VRI.
Returns
If UpdateDSSFlags.Simulate is not set in aFlags, the number of signature fields for which information has been added to the DSS will be returned. If UpdateDSSFlags.Simulate is set in aFlags, the number of eligible signature fields will be returned.
See also
updateDSS2()
void updateDSS2 ( out ReturnCode  aReturnCode,
string  aFieldName,
SignDocVerificationParameters  aParameters,
UpdateDSSFlags  aFlags 
)

Update the DSS for a signature of the document.

The main purpose of this function is testing SignDoc SDK, please use updateDSS() instead.

This function is available for PDF documents only.

Call this function (possibly a long time) after signing field aFieldName, then save the document incrementally and add a document time stamp. Before applying the first document time stamp, this function should be called for all eligable signature fields. If any document time stamp has already been added, this function should be called for the last document time stamp.

The signature field must have been signed with one of these methods: SigningMethod.DigSigPKCS7Detached, SigningMethod.DigSigPKCS7SHA1, SigningMethod.DigSigCadesDetached, or SigningMethod.DigSigCadesRFC3161.

This function does nothing if the signature field is not signed.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFieldNameThe name of the signature field.
[in]aParametersVerification parameters or null for default parameters.
[in]aFlagsFlags modifying the behavior of this function, see UpdateDSSFlags.Simulate and UpdateDSSFlags.VRI.
See also
addSignature(), updateDSS(), getFields()
SignDocVerificationResult verifySignature ( out ReturnCode  aReturnCode,
string  aFieldName 
)

Verify a signature of the document.

There is a setFlags() flag modifying the behavior of this function: DocumentFlags.RelaxByteRange.

Parameters
[in]aFieldNameThe name of the signature field.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
A new SignDocVerificationResult object describing the result of the verification.
See also
getSignature(), setFlags(), SignDocField.getSignatureType(), SignDocField.isSigned()
SignDocVerificationResult verifySignature2 ( out ReturnCode  aReturnCode,
SignDocSignature  aSignature 
)

Verify a signature of the document.

These are the differences between calling this function and calling verifySignature() with the field name obtained from aSignature:

  • This function fails unless aSignature.getClearedIndex() returns -1.
  • PDF only: This function uses the DSS of the first document time stamp following the signature described by aSignature. If there is no such document time stamp, the latest DSS will be used. This behavior is required for verifying signatures with LTV (long term validity).

There is a setFlags() flag modifying the behavior of this function: DocumentFlags.RelaxByteRange.

Parameters
[in]aSignatureA SignDocSignature object for this document.
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
A new SignDocVerificationResult object describing the result of the verification.
See also
getSignature(), setFlags(), verifySignature(), SignDocField.getSignatureType(), SignDocField.isSigned()
static string withEscapeSequence ( string  aText,
string  aLang 
)
static

Prepend an escape sequence for specifying the natural language in a text string.

Parameters
[in]aTextThe text.
[in]aLangLanguage identifier (an RFC3066 language tag with two-character language code and optional two-character country code). Only the language and the optional country will be used, the dash separating them will be removed. Example: "en-US" will prepend ESC "enUS" ESC.
Returns
A copy of aText with an escape sequence prepended.
See also
withoutEscapeSequences()
static string withoutEscapeSequences ( string  aInput)
static

Remove escape sequences specifying the natural language in text strings.

You don't need to call this function unless flag DocumentFlags.KeepEscapeSequences is set.

Parameters
[in]aInputThe input string.
Returns
A copy of aInput with escape sequences removed.
See also
splitEscapeSequences(), withEscapeSequence(), DocumentFlags.KeepEscapeSequences

The documentation for this class was generated from the following file: