Public Member Functions | Static Public Attributes | Protected Member Functions

de.softpro.doc.SignDocDocument Class Reference

An interface for SignDoc documents. More...

List of all members.

Public Member Functions

synchronized void close () throws SignDocException
 Close the document and the underlying file.
synchronized int getType () throws SignDocException
 Get the type of the document.
synchronized int getPageCount () throws SignDocException
 Get the number of pages of the document.
synchronized
SignDocSignatureParameters 
createSignatureParameters (String aFieldName, String aProfile) throws SignDocException
 Create a SignDocSignatureParameters object for signing a signature field.
synchronized String[] getProfiles (String aFieldName) throws SignDocException
 Get a list of profiles for a signature field.
synchronized void addSignature (SignDocSignatureParameters aSignatureParameters, SignDocVerificationParameters aVerificationParameters) throws SignDocException
 Sign the document.
synchronized String getLastTimestamp () throws SignDocException
 Get the timestamp used by the last successful call of addSignature().
synchronized String getPathname () throws SignDocException
 Get the current pathname of the document.
synchronized int getAvailableMethods () throws SignDocException
 Get a bitset indicating which signing methods are available for this document.
synchronized
SignDocVerificationResult 
verifySignature (String aFieldName) throws SignDocException
 Verify a signature of the document.
synchronized void clearSignature (String aFieldName) throws SignDocException
 Remove a signature of the document.
synchronized void clearAllSignatures () throws SignDocException
 Remove all signatures of the document.
synchronized void saveToStream (java.io.OutputStream aStream, int aFlags) throws SignDocException
 Save the document to a stream.
synchronized void saveToFile (String aPath, int aFlags) throws SignDocException
 Save the document to a file.
synchronized void copyToStream (java.io.OutputStream aStream, int aFlags) throws SignDocException
 Copy the document's current status or backing file or backing blob to a stream.
synchronized void copyAsSignedToStream (java.io.OutputStream aStream, String aFieldName) throws SignDocException
 Copy the document to a stream for viewing the document "as signed".
synchronized int getSaveToStreamFlags () throws SignDocException
 Get all flags currently valid for saveToStream().
synchronized int getSaveToFileFlags () throws SignDocException
 Get all flags currently valid for saveToFile().
synchronized int getRequiredSaveToFileFlags () throws SignDocException
 Get all flags currently required for saveToFile().
synchronized SignDocField[] getFields (int aTypes) throws SignDocException
 Get all interactive fields of the specified types.
synchronized SignDocField[] getFieldsOfPage (int aPage, int aTypes) throws SignDocException
 Get all interactive fields of the specified page, in tab order.
synchronized SignDocField getField (String aName) throws SignDocException
 Get an interactive field by name.
synchronized void setField (SignDocField aField, int aFlags) throws SignDocException
 Change a field.
synchronized void addField (SignDocField aField, int aFlags) throws SignDocException
 Add a field.
synchronized void removeField (String aName) throws SignDocException
 Remove a field.
synchronized void flattenField (String aName, int aWidget) throws SignDocException
 Flatten a field.
synchronized void flattenFields (int aFirstPage, int aLastPage, int aFlags) throws SignDocException
 Flatten all fields of the document or of a range of pages.
synchronized void exportFields (java.io.OutputStream aStream, int aFlags) throws SignDocException
 Export all fields as XML.
synchronized void applyFdf (String aPath, int aFlags) throws SignDocException
 Apply an FDF document to a PDF document.
synchronized
SignDocTextFieldAttributes 
getTextFieldAttributes () throws SignDocException
 Get the document's default text field attributes.
synchronized void setTextFieldAttributes (SignDocTextFieldAttributes aData) throws SignDocException
 Set the document's default text field attributes.
synchronized SignDocProperty[] getProperties (String aCollection) throws SignDocException
 Get the names and types of all SignDoc properties of a certain collection of properties of the document.
synchronized int getIntegerProperty (String aCollection, String aName) throws SignDocException
 Get the value of a SignDoc property (integer).
synchronized String getStringProperty (String aCollection, String aName) throws SignDocException
 Get the value of a SignDoc property (string).
synchronized boolean getBooleanProperty (String aCollection, String aName) throws SignDocException
 Get the value of a SignDoc property (boolean).
synchronized void setIntegerProperty (String aCollection, String aName, int aValue) throws SignDocException
 Set the value of a SignDoc property (integer).
synchronized void setStringProperty (String aCollection, String aName, String aValue) throws SignDocException
 Set the value of a SignDoc property (string).
synchronized void setBooleanProperty (String aCollection, String aName, boolean aValue) throws SignDocException
 Set the value of a SignDoc property (boolean).
synchronized void removeProperty (String aCollection, String aName) throws SignDocException
 Remove a SignDoc property.
synchronized void exportProperties (String aCollection, java.io.OutputStream aStream, int aFlags) throws SignDocException
 Export all properties (in all collections) as XML.
synchronized void importProperties (String aCollection, java.io.InputStream aStream, int aFlags) throws SignDocException
 Import properties from XML.
synchronized byte[] getDataBlock () throws SignDocException
 Get the SignDoc data block of the document.
synchronized void setDataBlock (byte[] aData) throws SignDocException
 Replace the SignDoc data block of the document.
synchronized double getResolutionX (int aPage) throws SignDocException
 Get the horizontal resolution of a page.
synchronized double getResolutionY (int aPage) throws SignDocException
 Get the vertical resolution of a page.
synchronized double getConversionFactorX (int aPage) throws SignDocException
 Get the horizontal conversion factor for a page.
synchronized double getConversionFactorY (int aPage) throws SignDocException
 Get the vertical conversion factor for a page.
synchronized double getPageWidth (int aPage) throws SignDocException
 Get the width of a page.
synchronized double getPageHeight (int aPage) throws SignDocException
 Get the height of a page.
synchronized double getBitsPerPixel (int aPage) throws SignDocException
 Get the number of bits per pixel (TIFF only).
synchronized double computeZoom (SignDocRenderParameters aParams) throws SignDocException
 Compute the zoom factor used for rendering.
synchronized void convCanvasPointToPagePoint (Point aPoint, SignDocRenderParameters aParams) throws SignDocException
 Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the current page.
synchronized void convPagePointToCanvasPoint (Point aPoint, SignDocRenderParameters aParams) throws SignDocException
 Convert a point expressed in document coordinate system of the current page to a point expressed in canvas (image) coordinates.
synchronized byte[] renderPageAsImage (SignDocRenderOutput aOutput, SignDocRenderParameters aRenderParameters, SignDocVerificationParameters aVerificationParameters, Rect aClipRect) throws SignDocException
 Render the selected page (or pages) as image.
synchronized void getRenderedSize (SignDocRenderOutput aOutput, SignDocRenderParameters aParams) throws SignDocException
 Get the size of the rendered page in pixels (without actually rendering it).
synchronized SignDocAnnotation createLineAnnotation (Point aStart, Point aEnd) throws SignDocException
 Create a line annotation.
synchronized SignDocAnnotation createLineAnnotation (double aStartX, double aStartY, double aEndX, double aEndY) throws SignDocException
 Create a line annotation.
synchronized SignDocAnnotation createScribbleAnnotation () throws SignDocException
 Create a scribble annotation.
synchronized SignDocAnnotation createFreeTextAnnotation (Point aLowerLeft, Point aUpperRight) throws SignDocException
 Create a text annotation.
synchronized SignDocAnnotation createFreeTextAnnotation (double aX0, double aY0, double aX1, double aY1) throws SignDocException
 Create a text annotation.
synchronized void addAnnotation (int aPage, SignDocAnnotation aAnnot) throws SignDocException
 Add an annotation to a page.
synchronized String[] getAnnotations (int aPage) throws SignDocException
 Get a list of all named annotations of a page.
synchronized SignDocAnnotation getAnnotation (int aPage, String aName) throws SignDocException
 Get a named annotation of a page.
synchronized void removeAnnotation (int aPage, String aName) throws SignDocException
 Remove an annotation identified by name.
synchronized void addText (String aText, int aPage, double aX, double aY, String aFontName, double aFontSize, SignDocColor aTextColor, double aOpacity, int aFlags) throws SignDocException
 Add text to a page.
synchronized void addTextRect (String aText, int aPage, double aX0, double aY0, double aX1, double aY1, String aFontName, double aFontSize, double aLineSkip, SignDocColor aTextColor, double aOpacity, int aHAlignment, int aVAlignment, int aFlags) throws SignDocException
 Add text in a rectangle of a page (with line breaking).
synchronized void addWatermark (SignDocWatermark aInput) throws SignDocException
 Add a watermark.
synchronized
SignDocFindTextPosition[] 
findText (int aFirstPage, int aLastPage, String aText, int aFlags) throws SignDocException
 Find text.
synchronized void addAttachmentBlob (String aName, String aDescription, String aType, String aModificationTime, byte[] aData, int aFlags) throws SignDocException
 Add an attachment to the document.
synchronized void addAttachmentFile (String aName, String aDescription, String aType, String aPath, int aFlags) throws SignDocException
 Add an attachment (read from a file) to the document.
synchronized void removeAttachment (String aName) throws SignDocException
 Remove an attachment from the document.
synchronized void changeAttachmentDescription (String aName, String aDescription) throws SignDocException
 Change the description of an attachment of the document.
synchronized String[] getAttachments () throws SignDocException
 Get a list of all attachments of the document.
synchronized SignDocAttachment getAttachment (String aName) throws SignDocException
 Get information about an attachment.
synchronized int checkAttachment (String aName) throws SignDocException
 Check the checksum of an attachment.
synchronized byte[] getAttachmentBlob (String aName) throws SignDocException
 Get an attachment as blob.
synchronized java.io.InputStream getAttachmentStream (String aName) throws SignDocException
 Get an InputStream for an attachment.
synchronized void addPage (int aTargetPage, double aWidth, double aHeight) throws SignDocException
 Add an empty page to the document.
synchronized void importPages (int aTargetPage, SignDocDocument aSource, int aSourcePage, int aPageCount, int aFlags) throws SignDocException
 Import pages from another document.
synchronized void importPageFromImageBlob (int aTargetPage, byte[] aData, double aZoom, double aWidth, double aHeight, int aFlags) throws SignDocException
 Import a page from a blob containing an image.
synchronized void importPageFromImageFile (int aTargetPage, String aPath, double aZoom, double aWidth, double aHeight, int aFlags) throws SignDocException
 Import a page from a file containing an image.
synchronized void addImageFromBlob (int aTargetPage, byte[] aData, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags) throws SignDocException
 Add an image (from a blob) to a page.
synchronized void addImageFromFile (int aTargetPage, String aPath, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags) throws SignDocException
 Add an image (from a blob) to a page.
synchronized void removePages (int[] aPages, int aMode) throws SignDocException
 Remove pages from the document.
synchronized void setCompatibility (int aMajor, int aMinor) throws SignDocException
 Request to not make changes to the document which are incompatible with an older version of this class.
synchronized boolean isModified () throws SignDocException
 Check if the document has unsaved changes.
synchronized void setFlags (int aFlags) throws SignDocException
 Set flags modifying the behavior of various functions.
synchronized int getFlags () throws SignDocException
 Get the flags set by setFlags().
synchronized void setCompressionLevel (int aLevel) throws SignDocException
 Set the FlateDecode compression level.
synchronized void removePermissions (int aFlags) throws SignDocException
 Remove signatures that grant permissions.
synchronized void removePDFA (int aFlags) throws SignDocException
 Remove PDF/A conformance.
synchronized void setShootInFoot (int aFlags) throws SignDocException
 Disable safety checks.
synchronized int getShootInFoot () throws SignDocException
 Get the flags set by setShootInFoot().

Static Public Attributes

static final int dt_unknown = 0
 Document type: unknown, for SignDocDocumentLoader.ping().
static final int dt_pdf = 1
 Document type: PDF document.
static final int dt_tiff = 2
 Document type: TIFF document.
static final int dt_other = 3
 Document type: Other document.
static final int dt_fdf = 4
 Document type: FDF document.
static final int sf_incremental = 0x01
 Save flag: Save incrementally (PDF).
static final int sf_remove_unused = 0x02
 Save flag: Remove unused objects (PDF).
static final int sf_linearized = 0x04
 Save flag: Linearize the document (PDF).
static final int sf_pdf_1_4 = 0x08
 Save flag: Do not use features introduced after PDF 1.4 for saving the document (PDF)
static final int sf_pdfa_buttons = 0x10
 Save flag: Fix appearance streams of check boxes and radio buttons for PDF/A documents.
static final int ctsf_unsaved = 0x01
 Flag for copyToStream(): Include unsaved changes.
static final int sff_font_fail = 0x01
 Flag for setField(), addField(), and applyFdf(): Fail if no suitable font is found.
static final int sff_font_warn = 0x02
 Flag for setField(), addField(), and applyFdf(): Warn if no suitable font is found.
static final int sff_font_ignore = 0x04
 Flag for setField(), addField(), and applyFdf(): Ignore font problems.
static final int sff_move = 0x08
 Flag for setField(): Move or resize field.
static final int sff_keep_ap = 0x10
 Flag for setField(), addField(), and applyFdf(): Keep appearance streams.
static final int sff_update_ap = 0x20
 Flag for setField() and applyFdf(): Update appearance streams.
static final int sff_fit_height_only = 0x40
 Flag for setField(), addField(), and applyFdf(): Compute the default font size such that the field contents fit the height of the field.
static final int sff_force_border_width = 0x80
 Flag for setField(), addField(), and applyFdf(): Use the border width specified by the field even if that will obliterate the field contents.
static final int sff_dont_break_lines = 0x100
 Flag for setField(), addField(), and applyFdf(): Do not break lines in multiline text fields.
static final int fff_include_signature_unsigned = 0x01
 Flags modifying the behavior of flattenFields(): Include unsigned signature fields.
static final int fff_include_signature_signed = 0x02
 Flags modifying the behavior of flattenFields(): Include signed signature fields.
static final int fff_include_hidden = 0x04
 Flags modifying the behavior of flattenFields(): Include hidden and invisible widgets.
static final int fff_keep_structure = 0x08
 Flags modifying the behavior of flattenFields(): Do not modify logical structure.
static final int ftf_ignore_hspace = 0x0001
 Flag for findText(): Ignore horizontal whitespace.
static final int ftf_ignore_hyphenation = 0x0002
 Flag for findText(): Ignore hyphenation.
static final int ftf_ignore_sequence = 0x0004
 Flag for findText(): Use character positions instead of sequence.
static final int e_top = 0x01
 Flag for exportFields() and exportProperties(): Include XML declaration and schema for top-level element.
static final int i_atomic = 0x01
 Flag for importProperties(): Modify all properties from XML or none (on error).
static final int ii_keep_aspect_ratio = 0x01
 Flag for addImageFromBlob(), addImageFromFile(), importPageFromImageBlob(), and importPageFromImageFile(): Keep aspect ratio of image, center image on white background.
static final int ii_brightest_transparent = 0x02
 Flag for addImageFromBlob() and addImageFromFile(): Make the brightest color transparent.
static final int kor_keep = 0
 Tell removePages() to keep the specified pages.
static final int kor_remove = 1
 Tell removePages() to remove the specified pages.
static final int car_match = 0
 Return value for checkAttachment(): The attachment matches its checksum.
static final int car_no_checksum = 1
 Return value for checkAttachment(): The attachment does not have a checksum.
static final int car_mismatch = 2
 Return value for checkAttachment(): The attachment does not match its checksum.
static final int ha_left = 0
 Horizontal alignment for addTextRect(): left.
static final int ha_center = 1
 Horizontal alignment for addTextRect(): center.
static final int ha_right = 2
 Horizontal alignment for addTextRect(): right.
static final int va_top = 0
 Vertical alignment for addTextRect(): top.
static final int va_center = 1
 Vertical alignment for addTextRect(): center.
static final int va_bottom = 2
 Vertical alignment for addTextRect(): bottom.
static final int f_relax_byte_range = 0x01
 Flag for setFlags(): Relax checking of ByteRange.
static final int f_ambiguous_button_value_empty = 0x02
 Flag for setFlags(): Make exportFields(), getField(), getFields(), and getFieldsOfPage() return an empty button value if there are multiple non-Off values for a check box field.
static final int siff_allow_breaking_signatures = 0x01
 Flag for setShootInFoot(): Allow operations to break existing signatures in signature fields.
static final int siff_allow_breaking_permissions = 0x02
 Flag for setShootInFoot(): Allow operations to break signatures which grant permissions.
static final int siff_allow_invalid_certificate = 0x04
 Flag for setShootInFoot(): Allow signing with a certificate that is not yet valid or no longer valid or which is not qualified for digital signatures.
static final int siff_allow_non_standard_external_fonts = 0x08
 Flag for setShootInFoot(): Allow non-standard usage of external (non-embedded) TrueType fonts.
static final int siff_assume_ap_not_shared = 0x10
 Assume that appearance dictionaries and appearance streams are not shared.
static final int siff_assume_ap_shared = 0x20
 Always assume that appearance dictionaries and appearance streams are shared.

Protected Member Functions

void finalize () throws Throwable
 Finalize this object.

Detailed Description

An interface for SignDoc documents.

An object of this class represents one document.

Use SignDocDocumentLoader.loadFromMemory(), SignDocDocumentLoader.loadFromFile(), or SignDocDocumentLoader.createPDF() to create objects.

If the document is loaded from a file, the file may remain in use until this object is destroyed or close() is called 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.

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:


Member Function Documentation

synchronized void de.softpro.doc.SignDocDocument.addAnnotation ( int  aPage,
SignDocAnnotation  aAnnot 
) throws SignDocException

Add an annotation to a page.

See SignDocAnnotation for details.

Parameters:
[in]aPageThe page number (1 for the first page).
[in]aAnnotThe new annotation.
See also:
createLineAnnotation(), createScribbleAnnotation()
synchronized void de.softpro.doc.SignDocDocument.addAttachmentBlob ( String  aName,
String  aDescription,
String  aType,
String  aModificationTime,
byte[]  aData,
int  aFlags 
) throws SignDocException

Add an attachment to the document.

Attachments are supported for PDF documents only.

Parameters:
[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 null and empty).
[in]aTypeThe MIME type of the attachment (can be null and empty).
[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 proper.
[in]aFlagsMust be zero.
See also:
addAttachmentFile(), getAttachments(), removeAttachment()
synchronized void de.softpro.doc.SignDocDocument.addAttachmentFile ( String  aName,
String  aDescription,
String  aType,
String  aPath,
int  aFlags 
) throws SignDocException

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

Attachments are supported for PDF documents only.

Parameters:
[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 null and empty).
[in]aTypeThe MIME type of the attachment (can be null and empty).
[in]aPathThe pathname of the file to be attached.
[in]aFlagsMust be zero.
See also:
addAttachmentBlob(), getAttachments(), removeAttachment()
synchronized void de.softpro.doc.SignDocDocument.addField ( SignDocField  aField,
int  aFlags 
) throws SignDocException

Add a field.

See the members of SignDocField for details.

This function can add check boxes, radio button groups, text fields, and signature fields to PDF documents.

When adding a radio button group or a check box field, a value must be set, see SignDocField.setValue() and SignDocField.setValueIndex().

The SignDocField.f_NoToggleToOff flag should be set for all radio button groups. Adobe products seem to ignore this flag being not set.

When adding a text field, the justification must be set with SignDocField.setJustification().

Currently, you don't have control over the appearance of the field being inserted except for the text field attributes.

Adding a field to a PDF document that doesn't contain any fields will set the document's default text field attributes to font Helvetica, font size 0, text color black.

Only signature fields can be added to PDF documents having signed signature fields.

TIFF documents support signature fields only and all signature fields must be inserted before the first signature is added to the document (you may want to use invisible fields) unless all existing signature fields have flag f_EnableAddAfterSigning set.

Parameters:
[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]aFlagsFlags modifying the behavior of this function, see sff_font_fail, sff_font_warn, sff_font_ignore, sff_keep_ap, sff_fit_height_only, sff_force_border_width, and sff_dont_break_lines.
See also:
getField(), removeField(), setField(), setTextFieldAttributes()
synchronized void de.softpro.doc.SignDocDocument.addImageFromBlob ( int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
int  aFlags 
) throws SignDocException

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

Parameters:
[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 ii_keep_aspect_ratio 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 ii_keep_aspect_ratio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero.
See also:
importPageFromImageBlob(), addImageFromFile()
synchronized void de.softpro.doc.SignDocDocument.addImageFromFile ( int  aTargetPage,
String  aPath,
double  aZoom,
double  aX,
double  aY,
double  aWidth,
double  aHeight,
int  aFlags 
) throws SignDocException

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

This function is not yet implemented.

Parameters:
[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 ii_keep_aspect_ratio 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 ii_keep_aspect_ratio must be set in aFlags.
[in]aFlagsFlags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero.
See also:
importPageFromImageBlob(), addImageFromFile()
synchronized void de.softpro.doc.SignDocDocument.addPage ( int  aTargetPage,
double  aWidth,
double  aHeight 
) throws SignDocException

Add an empty page to the document.

This function is currently implemented for PDF documents only.

Parameters:
[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).
synchronized void de.softpro.doc.SignDocDocument.addSignature ( SignDocSignatureParameters  aSignatureParameters,
SignDocVerificationParameters  aVerificationParameters 
) throws SignDocException

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 saved to memory or loaded from memory) and "OutputPath" is empty, the signed document will not be saved. Use

 doc.copyToStream (stream, 0);

to save the signed document in that case.

If string parameter "OutputPath" is set to the special value "<memory>" for a PDF document, it will be saved to memory and signed in memory. You'll have to save the document as described in the preceding paragraph.

Some document types may allow adding signatures only if all signatures of the documents are valid.

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

Parameters:
[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:
copyToStream(), createSignatureParameters(), getPathname(), setStringProperty()
synchronized void de.softpro.doc.SignDocDocument.addText ( String  aText,
int  aPage,
double  aX,
double  aY,
String  aFontName,
double  aFontSize,
SignDocColor  aTextColor,
double  aOpacity,
int  aFlags 
) throws SignDocException

Add text to a page.

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

Parameters:
[in]aTextThe text. Complex scripts are supported, see Complex Scripts.
[in]aPageThe 1-based page number of the page.
[in]aXThe X coordinate of the reference point of the first character in document coordinates.
[in]aYThe Y coordinate of the reference point of the first 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 must use an opacity of 1.0.
[in]aFlagsMust be 0.
See also:
addTextRect() addWatermark(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigStream()
Todo:
implement for TIFF documents
synchronized void de.softpro.doc.SignDocDocument.addTextRect ( String  aText,
int  aPage,
double  aX0,
double  aY0,
double  aX1,
double  aY1,
String  aFontName,
double  aFontSize,
double  aLineSkip,
SignDocColor  aTextColor,
double  aOpacity,
int  aHAlignment,
int  aVAlignment,
int  aFlags 
) throws SignDocException

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

Any sequence of CR and LF characters in the text starts a new paragraph (ie, text following such a sequence will be placed at the beginning of the next output line). In consequence, empty lines in the input do not produce empty lines in the output. To get an empty line in the output, you have to add a paragraph containing a non-breaking space (0xa0) only:

 "Line before empty line\n\u00A0\nLine after empty line"
Note:
Line breaking is not yet implemented for complex scripts.
Parameters:
[in]aTextThe text. Allowed control characters are CR and LF. Any sequence of CR and LF characters starts a new paragraph.
[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]aHAlignmentHorizontal alignment of the text (ha_left, ha_center, or ha_right).
[in]aVAlignmentVertical alignment of the text (va_top, va_center, or va_bottom).
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A must use an opacity of 1.0.
[in]aFlagsMust be 0.
See also:
addText() addWatermark(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigStream()
Todo:
implement for TIFF documents
synchronized void de.softpro.doc.SignDocDocument.addWatermark ( SignDocWatermark  aInput ) throws SignDocException

Add a watermark.

Parameters:
[in]aInputAn object describing the watermark.
See also:
addText(), addTextRect(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigStream()
Todo:
implement for TIFF documents
synchronized void de.softpro.doc.SignDocDocument.applyFdf ( String  aPath,
int  aFlags 
) throws SignDocException

Apply an FDF document to a PDF document.

FDF documents can be applied to PDF documents only.

Parameters:
[in]aPathThe pathname of the FDF document.
[in]aFlagsFlags modifying the behavior of this function, see sff_font_fail, sff_font_warn, sff_font_ignore, sff_keep_ap, sff_update_ap, sff_fit_height_only, sff_force_border_width, and sff_dont_break_lines.
synchronized void de.softpro.doc.SignDocDocument.changeAttachmentDescription ( String  aName,
String  aDescription 
) throws SignDocException

Change the description of an attachment of the document.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
[in]aDescriptionThe new description of the attachment (can be null and empty).
See also:
addAttachmentBlob(), addAttachmentFile(), getAttachments(), removeAttachment()
synchronized int de.softpro.doc.SignDocDocument.checkAttachment ( String  aName ) throws SignDocException

Check the checksum of an attachment.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
Returns:
car_match, car_no_checksum, or car_mismatch.
See also:
getAttachment(), getAttachments(), getAttachment(), getAttachmentBlob(), getAttachmentStream()
synchronized void de.softpro.doc.SignDocDocument.clearAllSignatures (  ) throws SignDocException

Remove all signatures of the document.

See also:
clearSignature()
synchronized void de.softpro.doc.SignDocDocument.clearSignature ( String  aFieldName ) throws SignDocException

Remove a signature of the document.

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

Parameters:
[in]aFieldNameThe name of the signature field.
See also:
clearAllSignatures(), getFields(), SignDocField.f_CurrentlyClearable
synchronized void de.softpro.doc.SignDocDocument.close (  ) throws SignDocException

Close the document and the underlying file.

After closing the document, all methods but close() will throw SignDocUnexpectedErrorException.

synchronized double de.softpro.doc.SignDocDocument.computeZoom ( SignDocRenderParameters  aParams ) throws SignDocException

Compute the zoom factor used for rendering.

If de.softpro.doc.SignDocRenderParameters.fitWidth(), de.softpro.doc.SignDocRenderParameters.fitHeight(), or de.softpro.doc.SignDocRenderParameters.fitRect() has been called, the actual factor depends on the document's page size. If multiple pages are selected (see de.softpro.doc.SignDocRenderParameters.setPages()), the maximum width and maximum height of all selected pages will be used.

Parameters:
[in]aParamsThe parameters such as the page number and the zoom factor.
Returns:
The computed zoom factor.
See also:
getRenderedSize(), renderPageAsImage(), SignDocRenderParameters.fitHeight(), SignDocRenderParameters.fitRect(), SignDocRenderParameters.fitWidth(), SignDocRenderParameters.setPages(), SignDocRenderParameters.setZoom()
synchronized void de.softpro.doc.SignDocDocument.convCanvasPointToPagePoint ( Point  aPoint,
SignDocRenderParameters  aParams 
) throws SignDocException

Convert a point expressed in canvas (image) coordinates to a point expressed in document coordinate system of the current page.

The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (see de.softpro.doc.SignDocRenderParameters.setPages()), the first page of the range will be used.

Suppose the current page of a PDF document has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,PH) and point (0,IH) will be converted to (0,0).

Parameters:
[in,out]aPointThe point to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
synchronized void de.softpro.doc.SignDocDocument.convPagePointToCanvasPoint ( Point  aPoint,
SignDocRenderParameters  aParams 
) throws SignDocException

Convert a point expressed in document coordinate system of the current page to a point expressed in canvas (image) coordinates.

The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (see de.softpro.doc.SignDocRenderParameters.setPages()), the first page of the range will be used.

Suppose the current page of a PDF document has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,IH) and point (0,PH) will be converted to (0,0).

Parameters:
[in,out]aPointThe point to be converted.
[in]aParamsThe parameters such as the page number and the zoom factor.
synchronized void de.softpro.doc.SignDocDocument.copyAsSignedToStream ( java.io.OutputStream  aStream,
String  aFieldName 
) throws SignDocException

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:
[in]aStreamThe file will be copied to this stream.
[in]aFieldNameThe name of the signature field.
Returns:
rc_ok if successful.
See also:
copyToStream(), SignDocDocumentLoader.loadFromMemory()
synchronized void de.softpro.doc.SignDocDocument.copyToStream ( java.io.OutputStream  aStream,
int  aFlags 
) throws SignDocException

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

If ctsf_unsaved is not set in aFlags , this function will copy to a stream the file or blob from which the document was loaded or to which the document was most recently saved. Changes made to the in-memory copy of the document since it was loaded or saved will not be reflected in the copy written to the stream.

If ctsf_unsaved is set in aFlags, unsaved changes made to the in-memory copy of the document will be included (as incremental update for PDF documents) in the stream.

This function does not have side effects on the in-memory copy of the document, that is, unsaved changes remain unsaved (except for being saved to the stream if ctsf_unsaved is set in aFlags).

Parameters:
[in]aStreamThe file will be copied to this stream.
[in]aFlagsFlags modifying the behavior of this function, see ctsf_unsaved.
See also:
copyAsSignedToStream(), saveToFile(), saveToStream(), SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.createFreeTextAnnotation ( Point  aLowerLeft,
Point  aUpperRight 
) throws SignDocException

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()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.createFreeTextAnnotation ( double  aX0,
double  aY0,
double  aX1,
double  aY1 
) throws SignDocException

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()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.createLineAnnotation ( Point  aStart,
Point  aEnd 
) throws SignDocException

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()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.createLineAnnotation ( double  aStartX,
double  aStartY,
double  aEndX,
double  aEndY 
) throws SignDocException

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()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.createScribbleAnnotation (  ) throws SignDocException

Create a scribble annotation.

See SignDocAnnotation for details.

Returns:
The new annotation object.
See also:
addAnnotation(), SignDocAnnotation.addPoint(), SignDocAnnotation.newStroke()
synchronized SignDocSignatureParameters de.softpro.doc.SignDocDocument.createSignatureParameters ( String  aFieldName,
String  aProfile 
) throws SignDocException

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

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.
Returns:
The new parameters object.
See also:
addSignature(), getProfiles()
synchronized void de.softpro.doc.SignDocDocument.exportFields ( java.io.OutputStream  aStream,
int  aFlags 
) throws SignDocException

Export all fields as XML.

This function always uses UTF-8 encoding. The output conforms to schema PdfFields.xsd.

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

Parameters:
[in]aStreamThe fields will be saved to this stream.
[in]aFlagsFlags modifying the behavior of this function, See e_top.
See also:
getFields(), setField()
Todo:
implement for TIFF
synchronized void de.softpro.doc.SignDocDocument.exportProperties ( String  aCollection,
java.io.OutputStream  aStream,
int  aFlags 
) throws SignDocException

Export all properties (in all collections) as XML.

/** 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:
[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 e_top.
See also:
importProperties()
void de.softpro.doc.SignDocDocument.finalize (  ) throws Throwable [protected]

Finalize this object.

Do not call this method unless you know what you are doing.

synchronized SignDocFindTextPosition [] de.softpro.doc.SignDocDocument.findText ( int  aFirstPage,
int  aLastPage,
String  aText,
int  aFlags 
) throws SignDocException

Find text.

Parameters:
[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 ftf_ignore_hspace, ftf_ignore_hyphenation, and ftf_ignore_sequence.
Returns:
The positions where aText was found or null if not found.
synchronized void de.softpro.doc.SignDocDocument.flattenField ( String  aName,
int  aWidget 
) throws SignDocException

Flatten a field.

Flattening a field of a PDF document makes its appearance part of the page and removes the selected widget or all widgets; the field will be removed when all its widgets have been flattened.

Flattening unsigned signature fields does not work correctly.

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

 SignDocDocument.siff_allow_breaking_permissions | SignDocDocument.siff_allow_breaking_signatures

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

Parameters:
[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()
synchronized void de.softpro.doc.SignDocDocument.flattenFields ( int  aFirstPage,
int  aLastPage,
int  aFlags 
) throws SignDocException

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

Flattening a field of a PDF document makes its appearance part of the page and removes the selected widget or all widgets; the field will be removed when all its widgets have been flattened. This function selects all widgets on the specified pages.

Flattening unsigned signature fields does not work correctly.

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

 SignDocDocument.siff_allow_breaking_permissions | SignDocDocument.siff_allow_breaking_signatures

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

Parameters:
[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 fff_include_signature_unsigned, fff_include_signature_signed, fff_include_hidden, and fff_keep_structure. If this value is 0, signature fields and hidden/invisible widgets will not be flattened.
See also:
flattenField(), removeField()
synchronized SignDocAnnotation de.softpro.doc.SignDocDocument.getAnnotation ( int  aPage,
String  aName 
) throws SignDocException

Get a named annotation of a page.

All setters will fail for the returned object.

Parameters:
[in]aPageThe page number (1 for the first page).
[in]aNameThe name of the annotation.
Returns:
The annotation object.
See also:
getAnnotations()
synchronized String [] de.softpro.doc.SignDocDocument.getAnnotations ( int  aPage ) throws SignDocException

Get a list of all named annotations of a page.

Unnamed annotations are ignored by this function.

Parameters:
[in]aPageThe page number (1 for the first page).
Returns:
The list of annotation names.
See also:
addAnnotation(), getAnnotation(), removeAnnotation(), SignDocAnnotation.setName()
synchronized SignDocAttachment de.softpro.doc.SignDocDocument.getAttachment ( String  aName ) throws SignDocException

Get information about an attachment.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
Returns:
Information about the attachment.
See also:
checkAttachment(), getAttachments(), getAttachmentBlob(), getAttachmentStream()
synchronized byte [] de.softpro.doc.SignDocDocument.getAttachmentBlob ( String  aName ) throws SignDocException

Get an attachment as blob.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
Returns:
The attachment's data.
See also:
checkAttachment(), getAttachments(), getAttachmentStream()
synchronized String [] de.softpro.doc.SignDocDocument.getAttachments (  ) throws SignDocException

Get a list of all attachments of the document.

Attachments are supported for PDF documents only.

Returns:
The names of the document's attachments. Use getAttachment() to get information for a single attachment.
See also:
checkAttachment(), getAttachment(), getAttachmentBlob(), getAttachmentStream()
synchronized java.io.InputStream de.softpro.doc.SignDocDocument.getAttachmentStream ( String  aName ) throws SignDocException

Get an InputStream for an attachment.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
Returns:
An InputStream object for the attachment's data.
rc_ok if successful.
See also:
checkAttachment(), getAttachments(), getAttachmentBlob()
synchronized int de.softpro.doc.SignDocDocument.getAvailableMethods (  ) throws SignDocException

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:
1<<SignDocSignatureParameters.m_digsig_pkcs1 etc.
See also:
SignDocSignatureParameters.getAvailableMethods()
synchronized double de.softpro.doc.SignDocDocument.getBitsPerPixel ( int  aPage ) throws SignDocException

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

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

Parameters:
[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).
synchronized boolean de.softpro.doc.SignDocDocument.getBooleanProperty ( String  aCollection,
String  aName 
) throws SignDocException

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()
synchronized double de.softpro.doc.SignDocDocument.getConversionFactorX ( int  aPage ) throws SignDocException

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

Parameters:
[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()
synchronized double de.softpro.doc.SignDocDocument.getConversionFactorY ( int  aPage ) throws SignDocException

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

Parameters:
[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()
synchronized byte [] de.softpro.doc.SignDocDocument.getDataBlock (  ) throws SignDocException

Get the SignDoc data block of the document.

Note:
This function is no longer supported; it always throws SignDocNotSupportedException.
Returns:
The serialized data block.
synchronized SignDocField de.softpro.doc.SignDocDocument.getField ( String  aName ) throws SignDocException

Get an interactive field by name.

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

Parameters:
[in]aNameThe fully-qualified name of the field.
Returns:
The selected field.
See also:
getFields(), setField()
synchronized SignDocField [] de.softpro.doc.SignDocDocument.getFields ( int  aTypes ) throws SignDocException

Get all interactive fields of the specified types.

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

Parameters:
[in]aTypes0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is de.softpro.doc.SignDocField.t_text, etc.
Returns:
An array containing the selected fields in the order in which they have been defined.
See also:
exportFields(), getField(), getFieldsOfPage()
synchronized SignDocField [] de.softpro.doc.SignDocDocument.getFieldsOfPage ( int  aPage,
int  aTypes 
) throws SignDocException

Get all interactive fields of the specified page, in tab order.

If the document does not specify a tab order, the fields will be returned in widget order.

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

Note:
Structure order (S) is not yet supported. If the page specifies structure order, the fields will be returned in widget order.
Parameters:
[in]aPageThe 1-based page number.
[in]aTypes0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is de.softpro.doc.SignDocField.t_text, etc.
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.
See also:
exportFields(), getField(), getFields()
synchronized int de.softpro.doc.SignDocDocument.getFlags (  ) throws SignDocException

Get the flags set by setFlags().

Returns:
The flags currently in force.
See also:
setFlags()
synchronized int de.softpro.doc.SignDocDocument.getIntegerProperty ( String  aCollection,
String  aName 
) throws SignDocException

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()
synchronized String de.softpro.doc.SignDocDocument.getLastTimestamp (  ) throws SignDocException

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.

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()
synchronized int de.softpro.doc.SignDocDocument.getPageCount (  ) throws SignDocException

Get the number of pages of the document.

Returns:
The number of pages.
synchronized double de.softpro.doc.SignDocDocument.getPageHeight ( int  aPage ) throws SignDocException

Get the height of a page.

Different pages of the document may have different sizes. Use getConversionFactorY() to get factors for converting the page height from document coordinates to real world dimensions.

Parameters:
[in]aPageThe page number (1 for the first page).
Returns:
The page height in document coordinates.
See also:
getConversionFactorY()
synchronized double de.softpro.doc.SignDocDocument.getPageWidth ( int  aPage ) throws SignDocException

Get the width of a page.

Different pages of the document may have different sizes. Use getConversionFactorX() to get factors for converting the page width from document coordinates to real world dimensions.

Parameters:
[in]aPageThe page number (1 for the first page).
Returns:
The page width in document coordinates.
See also:
getConversionFactorX()
synchronized String de.softpro.doc.SignDocDocument.getPathname (  ) throws SignDocException

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.

Returns:
The pathname or "".
synchronized String [] de.softpro.doc.SignDocDocument.getProfiles ( String  aFieldName ) throws SignDocException

Get a list of profiles for a signature field.

Parameters:
[in]aFieldNameThe name of the signature field.
Returns:
An array containign the names of all profiles supported by the signature field, excluding the default profile "" which is always available.
See also:
createSignatureParameters()
synchronized SignDocProperty [] de.softpro.doc.SignDocDocument.getProperties ( String  aCollection ) throws SignDocException

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.

Using the same property name in the "encrypted" and "public" collections is not possible. Attempts to get, set, or remove a property in the wrong collection will fail with error code rc_wrong_collection. To move a property from one collection to another collection, first remove it from the source collection, then add it to the target collection.

The "pdfa" collection is read-only and a property name existing in that collection does not prevent that property name from appearing in one of the other collections.

The syntax of property names depends on the document type and the collection containing the property.

"public" properties of PDF documents are stored according to XMP in namespace "http://www.softpro.de/pdfa/signdoc/public/", therefore property names must be valid unqualified XML names, see the syntax of "Name" in the XML 1.1 specification at http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-common-syn (section 2.3 Common Syntactic Constructs).

For "encrypted" properties and any properties in TIFF documents, property names can contain arbitrary Unicode characters except for NUL.

Parameters:
[in]aCollectionThe name of the collection, see above.
Returns:
The properties.
synchronized void de.softpro.doc.SignDocDocument.getRenderedSize ( SignDocRenderOutput  aOutput,
SignDocRenderParameters  aParams 
) throws SignDocException

Get the size of the rendered page in pixels (without actually rendering it).

The returned values may be approximations for some document formats. If multiple pages are selected (see de.softpro.doc.SignDocRenderParameters.setPages()), the maximum width and maximum height of all selected pages will be used.

Parameters:
[out]aOutputThe width and height of the image that would be computed by renderPageAsImage() with aClipRect being null will be stored here.
[in]aParamsParameters such as the page number.
See also:
renderPageAsImage()
synchronized int de.softpro.doc.SignDocDocument.getRequiredSaveToFileFlags (  ) throws SignDocException

Get all flags currently required for saveToFile().

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

Returns:
The flags.
See also:
getSaveToFileFlags(), saveToFile()
synchronized double de.softpro.doc.SignDocDocument.getResolutionX ( int  aPage ) throws SignDocException

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.

Parameters:
[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()
synchronized double de.softpro.doc.SignDocDocument.getResolutionY ( int  aPage ) throws SignDocException

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.

Parameters:
[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()
synchronized int de.softpro.doc.SignDocDocument.getSaveToFileFlags (  ) throws SignDocException

Get all flags currently valid for saveToFile().

Note that sf_incremental cannot be used together with sf_linearized even if all these flags are returned by this function. sf_pdfa_buttons is returned only if the document claims to be PDF/A-1-compliant.

Returns:
The flags.
See also:
getRequiredSaveToFileFlags(), getSaveToStreamFlags(), saveToFile()
synchronized int de.softpro.doc.SignDocDocument.getSaveToStreamFlags (  ) throws SignDocException

Get all flags currently valid for saveToStream().

sf_pdfa_buttons is returned only if the document claims to be PDF/A-1-compliant.

Returns:
The flags.
See also:
getSaveToFileFlags(), saveToStream()
synchronized int de.softpro.doc.SignDocDocument.getShootInFoot (  ) throws SignDocException

Get the flags set by setShootInFoot().

Returns:
The flags currently in force.
See also:
setShootInFoot()
synchronized String de.softpro.doc.SignDocDocument.getStringProperty ( String  aCollection,
String  aName 
) throws SignDocException

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()
synchronized SignDocTextFieldAttributes de.softpro.doc.SignDocDocument.getTextFieldAttributes (  ) throws SignDocException

Get the document's default text field attributes.

Returns:
A SignDocTextFieldAttributes object.
See also:
getField(), setTextFieldAttributes(), SignDocField.getTextFieldAttributes()
synchronized int de.softpro.doc.SignDocDocument.getType (  ) throws SignDocException

Get the type of the document.

Returns:
The document type.
See also:
dt_unknown, dt_pdf, dt_tiff, dt_other, dt_fdf
synchronized void de.softpro.doc.SignDocDocument.importPageFromImageBlob ( int  aTargetPage,
byte[]  aData,
double  aZoom,
double  aWidth,
double  aHeight,
int  aFlags 
) throws SignDocException

Import a page from a blob containing an image.

This function is currently implemented for PDF documents only.

Parameters:
[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 ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero.
See also:
importPageFromImageFile()
Todo:
multi-page TIFF
synchronized void de.softpro.doc.SignDocDocument.importPageFromImageFile ( int  aTargetPage,
String  aPath,
double  aZoom,
double  aWidth,
double  aHeight,
int  aFlags 
) throws SignDocException

Import a page from a file containing an image.

This function is currently implemented for PDF documents only.

Parameters:
[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 ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero.
See also:
importPageFromImageBlob()
Todo:
multi-page TIFF
synchronized void de.softpro.doc.SignDocDocument.importPages ( int  aTargetPage,
SignDocDocument  aSource,
int  aSourcePage,
int  aPageCount,
int  aFlags 
) throws SignDocException

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 intercative fields in the target document.

Page labels are currently ignored, that is, they will probably be messed up in the target document.

Logical structure is currently not imported.

Parameters:
[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 zero.
synchronized void de.softpro.doc.SignDocDocument.importProperties ( String  aCollection,
java.io.InputStream  aStream,
int  aFlags 
) throws SignDocException

Import properties from XML.

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

Parameters:
[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 i_atomic.
See also:
exportProperties()
synchronized boolean de.softpro.doc.SignDocDocument.isModified (  ) throws SignDocException

Check if the document has unsaved changes.

Returns:
true if the document has unsaved changes, false if the document does not have unsaved changes.
synchronized void de.softpro.doc.SignDocDocument.removeAnnotation ( int  aPage,
String  aName 
) throws SignDocException

Remove an annotation identified by name.

Parameters:
[in]aPageThe page number (1 for the first page).
[in]aNameThe name of the annotation, must not be empty.
See also:
addAnnotation(), getAnnotations(), SignDocAnnotation.setName()
synchronized void de.softpro.doc.SignDocDocument.removeAttachment ( String  aName ) throws SignDocException

Remove an attachment from the document.

Attachments are supported for PDF documents only.

Parameters:
[in]aNameThe name of the attachment.
See also:
addAttachmentBlob(), addAttachmentFile(), getAttachments()
synchronized void de.softpro.doc.SignDocDocument.removeField ( String  aName ) throws SignDocException

Remove a field.

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

Parameters:
[in]aNameThe fully-qualified name of the field.
See also:
addField(), flattenField(), getFields()
synchronized void de.softpro.doc.SignDocDocument.removePages ( int[]  aPages,
int  aMode 
) throws SignDocException

Remove pages from the document.

A document must have at least page. This function will fail if you attempt to remove all pages.

Fields will be removed if all their widgets are on removed pages.

Only signatures in signature fields having the SignDocField.f_SinglePage flag set can survive removal of pages.

Parameters:
[in]aPagesOne-based page numbers of pages to be removed. The order does not matter, neither does the number of occurences of a page number.
[in]aModeTell this function whether to keep (kor_keep) or to remove (kor_remove) the pages specified by aPages.
synchronized void de.softpro.doc.SignDocDocument.removePDFA ( int  aFlags ) throws SignDocException

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:
[in]aFlagsMust be 0.
See also:
removePermissions()
synchronized void de.softpro.doc.SignDocDocument.removePermissions ( int  aFlags ) throws SignDocException

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:
[in]aFlagsMust be 0.
See also:
removePDFA(), setShootInFoot()
synchronized void de.softpro.doc.SignDocDocument.removeProperty ( String  aCollection,
String  aName 
) throws SignDocException

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:
[in]aCollectionThe name of the collection, see getProperties().
[in]aNameThe name of the property.
See also:
getProperties(), setBooleanProperty(), setIntegerProperty(), setStringProperty()
synchronized byte [] de.softpro.doc.SignDocDocument.renderPageAsImage ( SignDocRenderOutput  aOutput,
SignDocRenderParameters  aRenderParameters,
SignDocVerificationParameters  aVerificationParameters,
Rect  aClipRect 
) throws SignDocException

Render the selected page (or pages) as image.

Parameters:
[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()
synchronized void de.softpro.doc.SignDocDocument.saveToFile ( String  aPath,
int  aFlags 
) throws SignDocException

Save the document to a file.

After a successful call to this function, the document behaves as if it had been loaded from the specified file.

Saving a signed PDF document without sf_incremental will fail, see getRequiredSaveToFileFlags().

Parameters:
[in]aPathThe pathname of the file to be created or overwritten. Pass null to save to the file from which the document was loaded or most recently saved (which will fail if the documment was loaded from memory or saved to a stream).
[in]aFlagsSet of flags (sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, and sf_remove_unused 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(), getRequiredSaveToFileFlags(), getSaveToFileFlags(), saveToStream(), sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused, SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
synchronized void de.softpro.doc.SignDocDocument.saveToStream ( java.io.OutputStream  aStream,
int  aFlags 
) throws SignDocException

Save the document to a stream.

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

Parameters:
[in]aStreamThe document will be saved to this stream.
[in]aFlagsSet of flags (sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, and sf_remove_unused 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(), sf_incremental, sf_linearized, sf_remove_unused, sf_pdf_1_4, sf_pdfa_buttons, SignDocDocumentLoader.loadFromFile(), SignDocDocumentLoader.loadFromMemory()
synchronized void de.softpro.doc.SignDocDocument.setBooleanProperty ( String  aCollection,
String  aName,
boolean  aValue 
) throws SignDocException

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:
[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(), addSignature()
synchronized void de.softpro.doc.SignDocDocument.setCompatibility ( int  aMajor,
int  aMinor 
) throws SignDocException

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:
[in]aMajorMajor version number.
[in]aMinorMinor version number.
synchronized void de.softpro.doc.SignDocDocument.setCompressionLevel ( int  aLevel ) throws SignDocException

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:
[in]aLevelThe new compression level for encoding data with the FlateDecode filter. Allowed values are 0 (fastest, do not use FlateDecode), and 0 (fast, least compression) through 9 (slowest, best compression). The default value is 6.
synchronized void de.softpro.doc.SignDocDocument.setDataBlock ( byte[]  aData ) throws SignDocException

Replace the SignDoc data block of the document.

Note:
This function is no longer supported; it always throws SignDocNotSupportedException.
Parameters:
[in]aDataNot used.
synchronized void de.softpro.doc.SignDocDocument.setField ( SignDocField  aField,
int  aFlags 
) throws SignDocException

Change a field.

This function changes a field in the document using attributes from a SignDocField object. Everything except for the name and the type of the field can be changed. See the member functions of SignDocField for details.

Always get a SignDocField object for a field by calling getField(), getFields(), or getFields(), then apply your modifications to that object, then call setField().

The coordinates of the field are not changed unless sff_move is set in aFlags.

Do not try to build a SignDocField object from scratch for changing a field as future versions of the SignDocField class may have additional attributes.

This function is implemented for PDF documents only.

This function always fails for PDF documents that have signed signature fields.

Parameters:
[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]aFlagsFlags modifying the behavior of this function, see sff_font_fail, sff_font_warn, sff_font_ignore, sff_move, sff_keep_ap, sff_update_ap, sff_fit_height_only, sff_force_border_width, and sff_dont_break_lines.
See also:
addField(), getFields(), removeField()
synchronized void de.softpro.doc.SignDocDocument.setFlags ( int  aFlags ) throws SignDocException

Set flags modifying the behavior of various functions.

The default is value is 0.

Parameters:
[in]aFlagsNew set of flags, see f_relax_byte_range and f_ambiguous_button_value_empty.
See also:
getFlags(), setShootInFoot()
synchronized void de.softpro.doc.SignDocDocument.setIntegerProperty ( String  aCollection,
String  aName,
int  aValue 
) throws SignDocException

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:
[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(), addSignature()
synchronized void de.softpro.doc.SignDocDocument.setShootInFoot ( int  aFlags ) throws SignDocException

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:
[in]aFlagsA set of flags, see siff_allow_breaking_signatures, siff_allow_breaking_permissions, siff_allow_invalid_certificate, and siff_allow_non_standard_external_fonts.
See also:
getShootInFoot(), removePermissions(), setFlags()
synchronized void de.softpro.doc.SignDocDocument.setStringProperty ( String  aCollection,
String  aName,
String  aValue 
) throws SignDocException

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.

Parameters:
[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(), addSignature()
synchronized void de.softpro.doc.SignDocDocument.setTextFieldAttributes ( SignDocTextFieldAttributes  aData ) throws SignDocException

Set the document's default text field attributes.

Font name, font size, and text color must be specified. This function fails if aInput 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:
[in,out]aDataThe new default text field attributes. The font resource name will be updated.
See also:
getTextFieldAttributes(), SignDocField.setTextFieldAttributes()
synchronized SignDocVerificationResult de.softpro.doc.SignDocDocument.verifySignature ( String  aFieldName ) throws SignDocException

Verify a signature of the document.

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

Parameters:
[in]aFieldNameThe name of the signature field.
Returns:
A new SignDocVerificationResult object describing the result of the verification.
See also:
SignDocField.isSigned()

Member Data Documentation

Return value for checkAttachment(): The attachment matches its checksum.

Return value for checkAttachment(): The attachment does not match its checksum.

Return value for checkAttachment(): The attachment does not have a checksum.

Flag for copyToStream(): Include unsaved changes.

See copyToStream() for details.

See also:
copyToStream()
final int de.softpro.doc.SignDocDocument.dt_fdf = 4 [static]

Document type: FDF document.

See also:
dt_other, dt_pdf, dt_tiff, dt_unknown

Document type: Other document.

See also:
dt_fdf, dt_pdf, dt_tiff, dt_unknown
final int de.softpro.doc.SignDocDocument.dt_pdf = 1 [static]

Document type: PDF document.

See also:
dt_fdf, dt_other, dt_tiff, dt_unknown

Document type: TIFF document.

See also:
dt_fdf, dt_other, dt_pdf, dt_unknown

Document type: unknown, for SignDocDocumentLoader.ping().

See also:
dt_fdf, dt_other, dt_pdf, dt_tiff
final int de.softpro.doc.SignDocDocument.e_top = 0x01 [static]

Flag for exportFields() and exportProperties(): Include XML declaration and schema for top-level element.

Flag for setFlags(): Make exportFields(), getField(), getFields(), and getFieldsOfPage() return an empty button value if there are multiple non-Off values for a check box field.

An empty button value will make setField() fail. Set this flag if you want to detect check box fields with ambiguous button values or if you want to keep the behavior of SignDoc SDK 4.0 and earlier.

If this flag is not set, the first non-Off value of a check box field will be used as button value. The ordering used for determining the first non-Off value is unspecified and may change with different versions of SignDoc SDK.

This flag is used for PDF documents only, it is ignored for TIFF documents.

See also:
getField(), getFlags(), setFlags(), f_relax_byte_range

Flag for setFlags(): Relax checking of ByteRange.

If this flag is set, ByteRange may have any values allowed by ISO 32000-1:2008. If this flag is not set, verifySignature() behaves like Adobe Reader: ByteRange must have two ranges, sorted by offset, and covering the complete document. (Covering the complete document is required for PAdES, the other two criterions are not.)

This flag is used for PDF documents only, it is ignored for TIFF documents.

See also:
getFlags(), setFlags(), verifySignature(), f_ambiguous_button_value_empty

Flags modifying the behavior of flattenFields(): Include hidden and invisible widgets.

Flags modifying the behavior of flattenFields(): Include signed signature fields.

Flags modifying the behavior of flattenFields(): Include unsigned signature fields.

Flags modifying the behavior of flattenFields(): Do not modify logical structure.

Set this flag only if you don't care about the logical structure of the document and fear problems due to errors in the logical structure. For instance, you might want to use this flag if flattening fields just for printing with a PDF component that does not support annotations and then throw away the document with the flattened fields.

Flag for findText(): Ignore horizontal whitespace.

This flag may be required for some document types.

See also:
ftf_ignore_hyphenation, ftf_ignore_sequence

Flag for findText(): Ignore hyphenation.

Note:
Not yet implemented
See also:
ftf_ignore_hspace, ftf_ignore_sequence

Flag for findText(): Use character positions instead of sequence.

Using this flag can be expensive.

Note:
Not yet implemented
See also:
ftf_ignore_hspace, ftf_ignore_hyphenation

Horizontal alignment for addTextRect(): center.

Horizontal alignment for addTextRect(): left.

Horizontal alignment for addTextRect(): right.

final int de.softpro.doc.SignDocDocument.i_atomic = 0x01 [static]

Flag for importProperties(): Modify all properties from XML or none (on error).

Flag for addImageFromBlob() and addImageFromFile(): Make the brightest color transparent.

This flag may be specified for addImageFromBlob() and addImageFromFile() only. importPageFromImageBlob() and importPageFromImageFile() always make the image opaque.

The rest of this description applies to addImageFromBlob() and addImageFromFile() only.

If the image has an alpha channel (or if its palette contains a transparent color), this flag will be ignored and the image's transparency will be used.

Transparency is not supported for JPEG images and JPEG-compressed TIFF images.

If this flag is not set, the image will be opaque unless the image has an alpha channel or transparent colors in its palette.

If this flag is set (and the image doesn't have an alpha channel and doesn't have transparent colors in its palette), white will be made transparent for truecolor images and the brightest color in the palette will be made transparent for indexed images (including grayscale images).

Flag for addImageFromBlob(), addImageFromFile(), importPageFromImageBlob(), and importPageFromImageFile(): Keep aspect ratio of image, center image on white background.

Tell removePages() to keep the specified pages.

Keep the specified pages, remove all other pages.

Tell removePages() to remove the specified pages.

Remove the specified pages, keep all other pages.

Save flag: Save incrementally (PDF).

See also:
saveToFile(), sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused

Save flag: Linearize the document (PDF).

This flag cannot be used with sf_incremental.

Note:
This flag is currently ignored, it will be supported again in a future version of SignDoc SDK.
See also:
saveToFile(), saveToStream(), sf_incremental, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused
Todo:
implement sf_linearized
final int de.softpro.doc.SignDocDocument.sf_pdf_1_4 = 0x08 [static]

Save flag: Do not use features introduced after PDF 1.4 for saving the document (PDF)

This flag is assumed to be set for PDF 1.4 (and older) documents.

See also:
saveToFile(), saveToStream(), sf_incremental, sf_linearized, sf_pdfa_buttons, sf_remove_unused

Save flag: Fix appearance streams of check boxes and radio buttons for PDF/A documents.

The appearance streams of a check box or radio button field added by addField() or modified by setField() or applyFdf() are not PDF/A-1-compliant.

To make the appearance streams of check boxes and radio buttons PDF/A-1-compliant, save the document with this flag set. The document will be modified in memory and then saved.

This flag is observed even if the document does not claim to be PDF/A-1-compliant.

Note:
After fixing appearance streams, check boxes and radio buttons can no longer be modified or operated as the button values (ie, the set of possible values) is lost.
See also:
saveToFile(), saveToStream(), sf_incremental, sf_linearized, sf_pdf_1_4, sf_remove_unused, SignDocSignatureParameters.pb_auto, SignDocSignatureParameters.pb_freeze

Save flag: Remove unused objects (PDF).

This flag is ignored, unused objects are always removed.

See also:
saveToFile(), saveToStream(), sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons

Flag for setField(), addField(), and applyFdf(): Do not break lines in multiline text fields.

You can use this flag to simulate the behavior of SignDoc SDK 4.0 and earlier.

See also:
addField(), applyFdf(), setField(), sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_font_warn, sff_force_border_width, sff_move, sff_keep_ap, sff_update_ap

Flag for setField(), addField(), and applyFdf(): Compute the default font size such that the field contents fit the height of the field.

If the font size for a text field, list box field, or combo box field is zero (see SignDocTextFieldAttributes.setFontSize()), the default font size will be used. This flag controls how the default font size is computed.

If this flag is set, the font size will be computed such that the field contents fit the height of the field. This is the behavior required by the PDF specification. If the field contents are too long, they will be truncated.

If this flag is not set, the font size will be computed such that the field contents fit both the height and the width of the field. This is the behavior implemented in, for instance, Adobe Acrobat.

This flag is assumed to be not set if line breaking is enabled.

See also:
applyFdf(), setField(), sff_dont_break_lines, sff_font_fail, sff_font_ignore, sff_font_warn, sff_force_border_width, sff_move, sff_keep_ap, sff_update_ap

Flag for setField(), addField(), and applyFdf(): Fail if no suitable font is found.

setField(), addField(), and applyFdf() won't modify/add the field and will throw SignDocFontNotFoundException if no font covering all required characters is found.

Exactly one of sff_font_fail, sff_font_warn, and sff_font_ignore must be specified.

See also:
addField(), applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_ignore, sff_font_font_warn, sff_force_border_width, sff_move, sff_keep_ap, sff_update_ap

Flag for setField(), addField(), and applyFdf(): Ignore font problems.

setField(), addField(), and applyFdf() will modify/add the field even if no font covering all required characters is found, and they won't report the problem to the caller. The appearance of the field won't represent the contents in that case.

Exactly one of sff_font_fail, sff_font_warn, and sff_font_ignore must be specified.

See also:
addField(), applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_force_border_width, sff_move, sff_keep_ap, sff_update_ap

Flag for setField(), addField(), and applyFdf(): Warn if no suitable font is found.

setField(), addField(), and applyFdf() will modify/add the field even if no font covering all required characters is found, but they will throw SignDocFontNotFoundException. The appearance of the field won't represent the contents in that case.

Exactly one of sff_font_fail, sff_font_warn, and sff_font_ignore must be specified.

See also:
addField(), applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_force_border_width, sff_move, sff_keep_ap, sff_update_ap

Flag for setField(), addField(), and applyFdf(): Use the border width specified by the field even if that will obliterate the field contents.

If this flag is set, the behavior matches that of Adobe Acrobat. If this flag is not set, the border width will be reduced to 1/16 of the field height or field width (whichever is smaller) if the border width specified by the field wouldn't leave enough space for the field contents.

See also:
addField(), applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_font_warn, sff_move, sff_keep_ap, sff_update_ap
final int de.softpro.doc.SignDocDocument.sff_keep_ap = 0x10 [static]

Flag for setField(), addField(), and applyFdf(): Keep appearance streams.

If this flag is set, setField() and applyFdf() won't touch the existing (or non-existing) appearance streams, addField() won't add any appearance streams.

Recomputing the appearance can have unexpected results (for instance, Adobe Acrobat and SignDoc SDK use different designs for check marks), therefore you might want to set this flag if you make changes that shall not affect the appearance such as setting the SignDocField.f_ReadOnly flag.

At most one of sff_keep_ap and sff_update_ap can be set.

See also:
addField(), applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_font_warn, sff_force_border_width, sff_move, sff_update_ap
final int de.softpro.doc.SignDocDocument.sff_move = 0x08 [static]

Flag for setField(): Move or resize field.

setField() does not update the coordinates of the field unless this flag is set as moving a field may require recomputing the appearance which can have unexpected results (for instance, Adobe Acrobat and SignDoc SDK use different designs for check marks). If this flag is not set, setField() ignores the coordinates set with SignDocField.setLeft(), SignDocField.setBottom(), SignDocField.setRight(), and SignDocField.setTop().

addField() ignores this flag, it always uses the coordinates. applyFdf() ignores this flag, it never moves or resizes fields.

See also:
setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_font_warn, sff_force_border_width, sff_keep_ap, sff_update_ap

Flag for setField() and applyFdf(): Update appearance streams.

If this flag is set, setField() and applyFdf() will always recompute the appearance streams of the field. (addField() always computes the appearance stream unless sff_keep_ap is set).

You might want to use this flag after changing the document's default text field attributes.

At most one of sff_keep_ap and sff_update_ap can be set.

If neither sff_keep_ap and sff_update_ap is set, setField() tries to update the appearance streams only if necessary; the exact behavior depends on the version of SignDoc SDK.

See also:
applyFdf(), setField(), sff_dont_break_lines, sff_fit_height_only, sff_font_fail, sff_font_ignore, sff_font_warn, sff_force_border_width, sff_move, sff_keep_ap

Flag for setShootInFoot(): Allow operations to break signatures which grant permissions.

This flag is available for PDF documents only.

See also:
siff_allow_breaking_signatures, siff_allow_invalid_certificate

Flag for setShootInFoot(): Allow operations to break existing signatures in signature fields.

This flag is available for PDF documents only.

See also:
siff_allow_breaking_permissions, siff_allow_invalid_certificate

Flag for setShootInFoot(): Allow signing with a certificate that is not yet valid or no longer valid or which is not qualified for digital signatures.

See also:
siff_allow_breaking_signatures, siff_allow_breaking_permissions

Flag for setShootInFoot(): Allow non-standard usage of external (non-embedded) TrueType fonts.

If this flag is not set, TrueType fonts must be embedded; when trying to use a TrueType font that is not embededded, SignDocFontNotFoundException will be thrown.

If this flag is set, external TrueType fonts are allowed. However, the document will violate Table 117, section 9.7.4.2 and section 9.7.5.2 of ISO 32000-1:2008.

Assume that appearance dictionaries and appearance streams are not shared.

If this flag is set and that assumption doesn't hold, changing one field may change the appearances of other fields.

At most one of siff_assume_ap_not_shared and siff_assume_ap_shared can be set. If neither flag is set, setField() and addSignature() look for shared objects. This can be expensive in terms of time and memory.

Always assume that appearance dictionaries and appearance streams are shared.

Setting this flag partially simulates the behavior of SignDoc SDK 3.x and older and causes a minor violation of section 12.7.3.3 of ISO 32000-1:2008 by setField().

At most one of siff_assume_ap_not_shared and siff_assume_ap_shared can be set. If neither flag is set, setField() and addSignature() look for shared objects. This can be expensive in terms of time and memory.

Vertical alignment for addTextRect(): bottom.

Vertical alignment for addTextRect(): center.

final int de.softpro.doc.SignDocDocument.va_top = 0 [static]

Vertical alignment for addTextRect(): top.


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