SignDoc SDK (Java)
5.0.0
|
An interface for SignDoc documents. More...
Public Member Functions | |
synchronized void | close () |
Close the document and the underlying file and destroy the underlying native object (for java.lang.AutoCloseable). More... | |
synchronized int | getType () throws SignDocException |
Get the type of the document. More... | |
synchronized int | getPageCount () throws SignDocException |
Get the number of pages of the document. More... | |
synchronized SignDocSignatureParameters | createSignatureParameters (String aFieldName, String aProfile) throws SignDocException |
Create a SignDocSignatureParameters object for signing a signature field. More... | |
synchronized SignDocSignatureParameters | createSignatureParametersForTimeStamp () throws SignDocException |
Create a SignDocSignatureParameters object for adding a document time stamp. More... | |
synchronized String[] | getProfiles (String aFieldName) throws SignDocException |
Get a list of profiles for a signature field. More... | |
synchronized void | addSignature (SignDocSignatureParameters aSignatureParameters, SignDocVerificationParameters aVerificationParameters) throws SignDocException |
Sign the document. More... | |
synchronized String | getLastTimestamp () throws SignDocException |
Get the timestamp used by the last successful call of addSignature(). More... | |
synchronized String | getPathname () throws SignDocException |
Get the current pathname of the document. More... | |
synchronized int | getAvailableMethods () throws SignDocException |
Get a bitset indicating which signing methods are available for this document. More... | |
synchronized int | getSignatureCount () throws SignDocException |
Get the number of signatures that can be retrieved with getSignature(). More... | |
synchronized SignDocSignature | getSignature (int aIndex) throws SignDocException |
Get a signature of the document. More... | |
synchronized SignDocVerificationResult | verifySignature (String aFieldName) throws SignDocException |
Verify a signature of the document. More... | |
synchronized SignDocVerificationResult | verifySignature2 (SignDocSignature aSignature) throws SignDocException |
Verify a signature of the document. More... | |
synchronized void | clearSignature (String aFieldName) throws SignDocException |
Remove a signature of the document. More... | |
synchronized void | clearAllSignatures () throws SignDocException |
Remove all signatures of the document. More... | |
synchronized void | clearApprovalSignatures () throws SignDocException |
Remove all approval signatures of the document. More... | |
synchronized int | updateDSS (SignDocVerificationParameters aParameters, int aFlags) throws SignDocException |
Update the DSS for any eligible signatures of the document. More... | |
synchronized void | updateDSS2 (String aFieldName, SignDocVerificationParameters aParameters, int aFlags) throws SignDocException |
Update the DSS for a signature of the document. More... | |
synchronized void | saveToStream (java.io.OutputStream aStream, int aFlags) throws SignDocException |
Save the document to a stream. More... | |
synchronized byte[] | saveToMemory (int aFlags) throws SignDocException |
Save the document to a blob. More... | |
synchronized void | saveToFile (String aPath, int aFlags) throws SignDocException |
Save the document to a file. More... | |
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. More... | |
synchronized byte[] | copyToMemory (int aFlags) throws SignDocException |
Copy the document's current status or backing file or backing blob to a blob. More... | |
synchronized void | copyAsSignedToStream (java.io.OutputStream aStream, String aFieldName) throws SignDocException |
Copy the document to a stream for viewing the document "as signed". More... | |
synchronized byte[] | copyAsSignedToMemory (String aFieldName) throws SignDocException |
Copy the document to a blob for viewing the document "as signed". More... | |
synchronized int | getSaveToStreamFlags () throws SignDocException |
Get all flags currently valid for saveToStream() and saveToMemory(). More... | |
synchronized int | getSaveToFileFlags () throws SignDocException |
Get all flags currently valid for saveToFile(). More... | |
synchronized int | getRequiredSaveToFileFlags () throws SignDocException |
Get all flags currently required for saveToFile(). More... | |
synchronized SignDocField[] | getFields (int aTypes) throws SignDocException |
Get all interactive fields of the specified types. More... | |
synchronized SignDocField[] | getFieldsOfPage (int aPage, int aTypes) throws SignDocException |
Get all interactive fields of the specified page, in tab order. More... | |
synchronized SignDocField | getField (String aName) throws SignDocException |
Get an interactive field by name. More... | |
synchronized void | setField (SignDocField aField, int aFlags) throws SignDocException |
Change a field. More... | |
synchronized void | addField (SignDocField aField, int aFlags) throws SignDocException |
Add a field. More... | |
synchronized void | removeField (String aName) throws SignDocException |
Remove a field. More... | |
synchronized void | flattenField (String aName, int aWidget) throws SignDocException |
Flatten a field. More... | |
synchronized void | flattenFields (int aFirstPage, int aLastPage, int aFlags) throws SignDocException |
Flatten all fields of the document or of a range of pages. More... | |
synchronized void | exportFields (java.io.OutputStream aStream, int aFlags) throws SignDocException |
Export all fields as XML to a stream. More... | |
synchronized byte[] | exportFieldsToMemory (int aFlags) throws SignDocException |
Export all fields as XML to a blob. More... | |
synchronized void | applyFdf (String aPath, int aFlags) throws SignDocException |
Apply an FDF document to a PDF document. More... | |
synchronized SignDocTextFieldAttributes | getTextFieldAttributes () throws SignDocException |
Get the document's default text field attributes. More... | |
synchronized void | setTextFieldAttributes (SignDocTextFieldAttributes aData) throws SignDocException |
Set the document's default text field attributes. More... | |
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. More... | |
synchronized int | getIntegerProperty (String aCollection, String aName) throws SignDocException |
Get the value of a SignDoc property (integer). More... | |
synchronized String | getStringProperty (String aCollection, String aName) throws SignDocException |
Get the value of a SignDoc property (string). More... | |
synchronized boolean | getBooleanProperty (String aCollection, String aName) throws SignDocException |
Get the value of a SignDoc property (boolean). More... | |
synchronized void | setIntegerProperty (String aCollection, String aName, int aValue) throws SignDocException |
Set the value of a SignDoc property (integer). More... | |
synchronized void | setStringProperty (String aCollection, String aName, String aValue) throws SignDocException |
Set the value of a SignDoc property (string). More... | |
synchronized void | setBooleanProperty (String aCollection, String aName, boolean aValue) throws SignDocException |
Set the value of a SignDoc property (boolean). More... | |
synchronized void | removeProperty (String aCollection, String aName) throws SignDocException |
Remove a SignDoc property. More... | |
synchronized void | exportProperties (String aCollection, java.io.OutputStream aStream, int aFlags) throws SignDocException |
Export properties as XML to a stream. More... | |
synchronized byte[] | exportPropertiesToMemory (String aCollection, int aFlags) throws SignDocException |
Export properties as XML to a blob. More... | |
synchronized void | importProperties (String aCollection, java.io.InputStream aStream, int aFlags) throws SignDocException |
Import properties from XML (reading a stream). More... | |
synchronized void | importPropertiesFromMemory (String aCollection, byte[] aBlob, int aFlags) throws SignDocException |
Import properties from XML (reading memory). More... | |
synchronized double | getResolutionX (int aPage) throws SignDocException |
Get the horizontal resolution of a page. More... | |
synchronized double | getResolutionY (int aPage) throws SignDocException |
Get the vertical resolution of a page. More... | |
synchronized double | getConversionFactorX (int aPage) throws SignDocException |
Get the horizontal conversion factor for a page. More... | |
synchronized double | getConversionFactorY (int aPage) throws SignDocException |
Get the vertical conversion factor for a page. More... | |
synchronized double | getPageWidth (int aPage) throws SignDocException |
Get the width of a page. More... | |
synchronized double | getPageHeight (int aPage) throws SignDocException |
Get the height of a page. More... | |
synchronized String | getPageLabel (int aPage) throws SignDocException |
Get the page label for a page number. More... | |
synchronized int | getBitsPerPixel (int aPage) throws SignDocException |
Get the number of bits per pixel (TIFF only). More... | |
synchronized double | computeZoom (SignDocRenderParameters aParams) throws SignDocException |
Compute the zoom factor used for rendering. More... | |
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 specified page. More... | |
synchronized void | convPagePointToCanvasPoint (Point aPoint, SignDocRenderParameters aParams) throws SignDocException |
Convert a point expressed in document coordinate system of the specified page to a point expressed in canvas (image) coordinates. More... | |
synchronized Rect | convImageRectToPageRect (SignDocImageRect aInput, SignDocRenderParameters aParams) throws SignDocException |
Convert a rectangle expressed in canvas (image) coordinates to a rectangle expressed in document coordinate system of the specified page. More... | |
synchronized SignDocImageRect | convPageRectToImageRect (Rect aInput, SignDocRenderParameters aParams) throws SignDocException |
Convert a rectangle expressed in document coordinate system of the specified page to a rectangle expressed in canvas (image) coordinates. More... | |
synchronized byte[] | renderPageAsImage (SignDocRenderOutput aOutput, SignDocRenderParameters aRenderParameters, SignDocVerificationParameters aVerificationParameters, Rect aClipRect) throws SignDocException |
Render the selected page (or pages) as image. More... | |
synchronized SignDocImage | renderPageAsSignDocImage (SignDocRenderOutput aOutput, SignDocRenderParameters aRenderParameters, SignDocVerificationParameters aVerificationParameters, Rect aClipRect) throws SignDocException |
Render the selected page as SignDocImage object. More... | |
synchronized SignDocRenderOutput | getRenderedSize (SignDocRenderParameters aParams) throws SignDocException |
Get the size of the rendered page in pixels (without actually rendering it). More... | |
synchronized SignDocAnnotation | createLineAnnotation (Point aStart, Point aEnd) throws SignDocException |
Create a line annotation. More... | |
synchronized SignDocAnnotation | createLineAnnotation (double aStartX, double aStartY, double aEndX, double aEndY) throws SignDocException |
Create a line annotation. More... | |
synchronized SignDocAnnotation | createScribbleAnnotation () throws SignDocException |
Create a scribble annotation. More... | |
synchronized SignDocAnnotation | createFreeTextAnnotation (Point aLowerLeft, Point aUpperRight) throws SignDocException |
Create a text annotation. More... | |
synchronized SignDocAnnotation | createFreeTextAnnotation (double aX0, double aY0, double aX1, double aY1) throws SignDocException |
Create a text annotation. More... | |
synchronized void | addAnnotation (int aPage, SignDocAnnotation aAnnot) throws SignDocException |
Add an annotation to a page. More... | |
synchronized String[] | getAnnotations (int aPage) throws SignDocException |
Get a list of all named annotations of a page. More... | |
synchronized SignDocAnnotation | getAnnotation (int aPage, String aName) throws SignDocException |
Get a named annotation of a page. More... | |
synchronized void | removeAnnotation (int aPage, String aName) throws SignDocException |
Remove an annotation identified by name. More... | |
synchronized void | flattenAnnotations (int aFirstPage, int aLastPage, int aFlags) throws SignDocException |
Flatten all annotations of the document or of a range of pages. More... | |
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. More... | |
synchronized void | addText2 (String aText, int aPage, double aX, double aY, String aFontName, double aFontSize, SignDocColor aTextColor, double aOpacity, int aFlags, String aLang) throws SignDocException |
Add text to a page (with language identifier). More... | |
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). More... | |
synchronized void | addTextRect2 (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, String aLang) throws SignDocException |
Add text in a rectangle of a page (with line breaking and language identifier). More... | |
synchronized void | addWatermark (SignDocWatermark aInput) throws SignDocException |
Add a watermark. More... | |
synchronized SignDocFindTextOccurrence[] | findText (int aFirstPage, int aLastPage, String aText, int aFlags) throws SignDocException |
Find text. More... | |
synchronized SignDocTextIterator | createTextIterator (int aFirstPage, int aLastPage, int aFlags) throws SignDocException |
Create an iterator that visits all the text of a range of pages. More... | |
synchronized void | addAttachmentBlob (String aName, String aDescription, String aType, String aModificationTime, byte[] aData, int aFlags) throws SignDocException |
Add an attachment to the document. More... | |
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. More... | |
synchronized void | removeAttachment (String aName) throws SignDocException |
Remove an attachment from the document. More... | |
synchronized void | changeAttachmentDescription (String aName, String aDescription) throws SignDocException |
Change the description of an attachment of the document. More... | |
synchronized String[] | getAttachments () throws SignDocException |
Get a list of all attachments of the document. More... | |
synchronized SignDocAttachment | getAttachment (String aName) throws SignDocException |
Get information about an attachment. More... | |
synchronized int | checkAttachment (String aName) throws SignDocException |
Check the checksum of an attachment. More... | |
synchronized byte[] | getAttachmentBlob (String aName) throws SignDocException |
Get an attachment as blob. More... | |
synchronized java.io.InputStream | getAttachmentStream (String aName) throws SignDocException |
Get an InputStream for an attachment. More... | |
synchronized void | addPage (int aTargetPage, double aWidth, double aHeight) throws SignDocException |
Add an empty page to the document. More... | |
synchronized void | importPages (int aTargetPage, SignDocDocument aSource, int aSourcePage, int aPageCount, int aFlags) throws SignDocException |
Import pages from another document. More... | |
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. More... | |
synchronized void | importPageFromImageBlob2 (int aTargetPage, byte[] aData, double aZoom, double aWidth, double aHeight, int aFlags, String aDescription, String aLang) throws SignDocException |
Import a page from a blob containing an image (with alternate description). More... | |
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. More... | |
synchronized void | importPageFromImageFile2 (int aTargetPage, String aPath, double aZoom, double aWidth, double aHeight, int aFlags, String aDescription, String aLang) throws SignDocException |
Import a page from a file containing an image (with alternate description). More... | |
synchronized void | addImageFromMemory (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. More... | |
synchronized void | addImageFromMemory2 (int aTargetPage, byte[] aData, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags, String aDescription, String aLang) throws SignDocException |
Add an image (from a blob) to a page (with alternate description). More... | |
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 file) to a page. More... | |
synchronized void | addImageFromFile2 (int aTargetPage, String aPath, double aZoom, double aX, double aY, double aWidth, double aHeight, int aFlags, String aDescription, String aLang) throws SignDocException |
Add an image (from a file) to a page. More... | |
synchronized void | removePages (int[] aPages, int aMode) throws SignDocException |
Remove pages from the document. More... | |
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. More... | |
synchronized boolean | isModified () throws SignDocException |
Check if the document has unsaved changes. More... | |
synchronized boolean | isTaggedPDF () throws SignDocException |
Check if the document is a Tagged PDF document. More... | |
synchronized void | setFlags (int aFlags) throws SignDocException |
Set flags modifying the behavior of various functions. More... | |
synchronized int | getFlags () throws SignDocException |
Get the flags set by setFlags(). More... | |
synchronized void | setCompressionLevel (int aLevel) throws SignDocException |
Set the FlateDecode compression level. More... | |
synchronized int | getDocMDP () throws SignDocException |
Get the DocMDP P value of the document's certification signature. More... | |
synchronized int | getLockMDP () throws SignDocException |
Get the lowest lock MDP value of the signed signature fields. More... | |
synchronized void | removeDocMDP () throws SignDocException |
Remove any certification signature. More... | |
synchronized void | removePermissions (int aFlags) throws SignDocException |
Remove signatures that grant permissions. More... | |
synchronized void | removePDFA (int aFlags) throws SignDocException |
Remove PDF/A conformance. More... | |
synchronized void | removePDFUA (int aFlags) throws SignDocException |
Remove PDF/UA conformance. More... | |
synchronized void | removeLogicalStructure (int aFlags) throws SignDocException |
Remove the logical structure. More... | |
synchronized void | removeXFA (int aFlags) throws SignDocException |
Remove XFA (XML Forms Architecture) content. More... | |
synchronized String | getDocumentLanguage () throws SignDocException |
Get the document's natural language. More... | |
synchronized void | setDocumentLanguage (String aLang) throws SignDocException |
Set the document's natural language. More... | |
synchronized void | setDefaultDocumentLanguage (String aLang) throws SignDocException |
Set the language identifier to be used if a language identifier is required but the document doesn't provide one. More... | |
synchronized void | setShootInFoot (int aFlags) throws SignDocException |
Disable safety checks. More... | |
synchronized int | getShootInFoot () throws SignDocException |
Get the flags set by setShootInFoot(). More... | |
Static Public Member Functions | |
static String[] | splitEscapeSequences (String aInput) |
Split a string obtained from a PDF text string into escape sequences and text segments. More... | |
static String | withoutEscapeSequences (String aInput) |
Remove escape sequences specifying the natural language in text strings. More... | |
static String | withEscapeSequence (String aText, String aLang) |
Prepend an escape sequence for specifying the natural language in a text string. More... | |
Static Public Attributes | |
static final int | dt_unknown = 0 |
Document type: unknown, for SignDocDocumentLoader.ping(). More... | |
static final int | dt_pdf = 1 |
Document type: PDF document. More... | |
static final int | dt_tiff = 2 |
Document type: TIFF document. More... | |
static final int | dt_other = 3 |
Document type: Other document. More... | |
static final int | dt_fdf = 4 |
Document type: FDF document. More... | |
static final int | sf_incremental = 0x01 |
Save flag: Save incrementally (PDF). More... | |
static final int | sf_remove_unused = 0x02 |
Save flag: Remove unused objects (PDF). More... | |
static final int | sf_linearized = 0x04 |
Save flag: Linearize the document (PDF). More... | |
static final int | sf_pdf_1_4 = 0x08 |
Save flag: Do not use features introduced after PDF 1.4 for saving the document (PDF) More... | |
static final int | sf_pdfa_buttons = 0x10 |
Save flag: Fix appearance streams of check boxes and radio buttons for conformance with PDF/A-1 without Technical Corrigendum 2. More... | |
static final int | sf_auto_incremental = 0x20 |
Save flag: Automatically set sf_incremental if needed, automatically reset sf_incremental if not allowed. More... | |
static final int | ctsf_unsaved = 0x01 |
Flag for copyToStream() and copyToMemory(): Include unsaved changes. More... | |
static final int | sff_font_fail = 0x01 |
Flag for setField(), addField(), and applyFdf(): Fail if no suitable font is found. More... | |
static final int | sff_move = 0x08 |
Flag for setField(): Move or resize field. More... | |
static final int | sff_keep_ap = 0x10 |
Flag for setField(), addField(), and applyFdf(): Keep appearance streams. More... | |
static final int | sff_update_ap = 0x20 |
Flag for setField() and applyFdf(): Update appearance streams. More... | |
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. More... | |
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. More... | |
static final int | sff_dont_break_lines = 0x100 |
Flag for setField(), addField(), and applyFdf(): Do not break lines in multiline text fields. More... | |
static final int | sff_auto_alignment = 0x200 |
Flag for setField(), addField(), and applyFdf(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run. More... | |
static final int | sff_ltr = 0x1000 |
Flag for setField(), addField(), and applyFdf(): Paragraph direction: LTR. More... | |
static final int | sff_rtl = 0x2000 |
Flag for setField(), addField(), and applyFdf(): Paragraph direction: RTL. More... | |
static final int | sff_default_ltr = 0x4000 |
Flag for setField(), addField(), and applyFdf(): Choose direction automatically, default to LTR. More... | |
static final int | sff_default_rtl = 0x8000 |
Flag for setField(), addField(), and applyFdf(): Choose direction automatically, default to RTL. More... | |
static final int | fff_include_signature_unsigned = 0x01 |
Flags modifying the behavior of flattenFields(): Include unsigned signature fields. More... | |
static final int | fff_include_signature_signed = 0x02 |
Flags modifying the behavior of flattenFields(): Include signed signature fields. More... | |
static final int | fff_include_hidden = 0x04 |
Flags modifying the behavior of flattenFields(): Include hidden and invisible widgets. More... | |
static final int | fff_keep_structure = 0x08 |
Flags modifying the behavior of flattenFields(): Do not modify logical structure. More... | |
static final int | faf_include_hidden = 0x04 |
Flags modifying the behavior of flattenAnnotations(): Include hidden and invisible annotations. More... | |
static final int | faf_keep_structure = 0x08 |
Flags modifying the behavior of flattenAnnotations(): Do not modify logical structure. More... | |
static final int | ftf_ignore_hspace = 0x0001 |
Flag for findText(): Ignore horizontal whitespace (may be required). More... | |
static final int | ftf_ignore_hyphenation = 0x0002 |
Flag for findText(): Ignore hyphenation. More... | |
static final int | ftf_ignore_sequence = 0x0004 |
Flag for findText(): Use character positions instead of searching the characters in the document in the sequence they are encountered. More... | |
static final int | e_top = 0x01 |
Flag for exportFields(), exportFieldsToMemory(), exportProperties(), and exportPropertiesToMemory(): Include XML declaration and schema for top-level element. More... | |
static final int | i_atomic = 0x01 |
Flag for importProperties() and importPropertiesFromMemory(): Modify all properties from XML or none (on error). More... | |
static final int | ii_keep_aspect_ratio = 0x01 |
Flag for addImageFromFile(), addImageFromFile2(), addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageBlob2(), importPageFromImageFile(), and importPageFromImageFile2(): Keep aspect ratio of image, center image on white background. More... | |
static final int | ii_brightest_transparent = 0x02 |
Flag for addImageFromFile(), addImageFromFile2(), addImageFromMemory(), and addImageFromMemory2(): Make the brightest color transparent. More... | |
static final int | kor_keep = 0 |
Tell removePages() to keep the specified pages. More... | |
static final int | kor_remove = 1 |
Tell removePages() to remove the specified pages. More... | |
static final int | car_match = 0 |
Return value for checkAttachment(): The attachment matches its checksum. More... | |
static final int | car_no_checksum = 1 |
Return value for checkAttachment(): The attachment does not have a checksum. More... | |
static final int | car_mismatch = 2 |
Return value for checkAttachment(): The attachment does not match its checksum. More... | |
static final int | ha_left = 0 |
Horizontal alignment for addTextRect(): Align left. More... | |
static final int | ha_center = 1 |
Horizontal alignment for addTextRect(): Center. More... | |
static final int | ha_right = 2 |
Horizontal alignment for addTextRect(): Align right. More... | |
static final int | ha_auto = 4 |
Horizontal alignment for addTextRect(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run. More... | |
static final int | va_top = 0 |
Vertical alignment for addTextRect(): Align top. More... | |
static final int | va_center = 1 |
Vertical alignment for addTextRect(): Center. More... | |
static final int | va_bottom = 2 |
Vertical alignment for addTextRect(): Align bottom. More... | |
static final int | atrf_compat = 0x01 |
Flag for addTextRect(): Behave like addTextRect() of SignDoc SDK 4.2.0.8 and earlier. More... | |
static final int | atrf_ltr = 0x1000 |
Flag for addTextRect(): Paragraph direction: LTR. More... | |
static final int | atrf_rtl = 0x2000 |
Flag for addTextRect(): Paragraph direction: RTL. More... | |
static final int | atrf_default_ltr = 0x4000 |
Flag for addTextRect(): Choose direction automatically, default to LTR. More... | |
static final int | atrf_default_rtl = 0x8000 |
Flag for addTextRect(): Choose direction automatically, default to RTL. More... | |
static final int | f_relax_byte_range = 0x01 |
Flag for setFlags(): Relax checking of ByteRange. More... | |
static final int | f_ambiguous_button_value_empty = 0x02 |
Flag for setFlags(): Make exportFields(), exportFieldsToMemory(), getField(), getFields(), and getFieldsOfPage() return an empty button value if there are multiple non-Off values for a check box field. More... | |
static final int | f_use_dss_only = 0x04 |
Flag for setFlags(): Use only the Document Security Store for building the certificate chain and for checking the revocation state of the certificates, ignore any certificates, CRLs, and OCSP responses from the signature proper. More... | |
static final int | f_no_kerning_for_standard_fonts = 0x08 |
Flag for setFlags(): Disable kerning for standard fonts. More... | |
static final int | f_unused_0x10 = 0x10 |
Flag for setFlags(): Unused flag. More... | |
static final int | f_keep_escape_sequences = 0x20 |
Flag for setFlags(): Do not remove escape sequences specifying the natural language from text strings. More... | |
static final int | f_require_alternate_field_name = 0x40 |
Flag for setFlags(): Require alternate field names. More... | |
static final int | f_require_lang = 0x80 |
Flag for setFlags(): Require language identifier for text. More... | |
static final int | f_insert_at_end = 0x100 |
Flag for setFlags(): Do not attempt to insert new objects into the logical structure in reading order. More... | |
static final int | f_use_escape_sequences = 0x200 |
Flag for setFlags(): Use escape sequences to encode the natural language in alternate field names. More... | |
static final int | f_fail_for_broken_target_structure = 0x400 |
Flag for setFlags(): Fail if a new object cannot be inserted into the logical structure of the target document due to that logical structure being broken. More... | |
static final int | f_no_actual_text = 0x800 |
Flag for setFlags(): Do not add Actualtext property to marked-content sequences. More... | |
static final int | siff_allow_breaking_signatures = 0x01 |
Flag for setShootInFoot(): Allow operations to break existing signatures in signature fields. More... | |
static final int | siff_allow_breaking_permissions = 0x02 |
Flag for setShootInFoot(): Allow operations to break signatures which grant permissions. More... | |
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. More... | |
static final int | siff_allow_non_standard_external_fonts = 0x08 |
Flag for setShootInFoot(): Allow non-standard usage of external (non-embedded) TrueType and CFF fonts. More... | |
static final int | siff_assume_ap_not_shared = 0x10 |
Flag for setShootInFoot(): Assume that appearance dictionaries and appearance streams are not shared. More... | |
static final int | siff_assume_ap_shared = 0x20 |
Flag for setShootInFoot(): Always assume that appearance dictionaries and appearance streams are shared. More... | |
static final int | siff_dont_verify_after_signing = 0x40 |
Flag for setShootInFoot(): Disable verification of signature after signing by addSignature(). More... | |
static final int | siff_allow_all_curves = 0x80 |
Flag for setShootInFoot(): Allow elliptic curves for signing which are not supported by Adobe products for Windows. More... | |
static final int | siff_allow_breaking_tagged_pdf = 0x100 |
Flag for setShootInFoot(): Allow operations to break Tagged PDF (and PDF/UA). More... | |
static final int | udf_simulate = 0x01 |
Flag for updateDSS() and updateDSS2(): Perform all the checks but do not modify the document. More... | |
static final int | udf_vri = 0x02 |
Flag for updateDSS() and updateDSS2(): Create VRI dictionaries. More... | |
Protected Member Functions | |
void | finalize () throws Throwable |
Finalize this object. More... | |
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:
synchronized void addAnnotation | ( | int | aPage, |
SignDocAnnotation | aAnnot | ||
) | throws SignDocException |
Add an annotation to a page.
See SignDocAnnotation for details.
[in] | aPage | The page number (1 for the first page). |
[in] | aAnnot | The new annotation. |
synchronized void 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.
[in] | aName | The name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons. |
[in] | aDescription | The description of the attachment (can be null and empty). |
[in] | aType | The MIME type of the attachment (can be null and empty except for PDF/A-3 documents). |
[in] | aModificationTime | The time and date of the last modification of the file being attached to the document (can be empty). Must be in ISO 8601 extended calendar date format with optional timezone. |
[in] | aData | The attachment proper. |
[in] | aFlags | Must be zero. |
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.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. Will also be used as filename of the attachment and must not contain slashes, backslashes, and colons. |
[in] | aDescription | The description of the attachment (can be null and empty except for PDF/A-3 documents). |
[in] | aType | The MIME type of the attachment (can be null and empty). |
[in] | aPath | The pathname of the file to be attached. |
[in] | aFlags | Must be zero. |
synchronized void 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.
[in,out] | aField | The new field. The font resource name of the default text field attributes may be modified. The value index and the value may be modified for radio button fields and check box fields. |
[in] | aFlags | Set of flags (sff_keep_ap, sff_fit_height_only, sff_force_border_width, sff_dont_break_lines, sff_auto_alignment, sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl) combined with `|' modifying the behavior of this function. Pass 0 for no flags. |
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 file) to a page.
This function behaves like addImageFromFile2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use addImageFromFile2() with a meaningful description of the image.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Image height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
synchronized void addImageFromFile2 | ( | int | aTargetPage, |
String | aPath, | ||
double | aZoom, | ||
double | aX, | ||
double | aY, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags, | ||
String | aDescription, | ||
String | aLang | ||
) | throws SignDocException |
Add an image (from a file) to a page.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Image height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
[in] | aDescription | Alternate description for the image. If this value is null or an empty string, aLang will be ignored. If this value is null or an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used. |
[in] | aLang | Language identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US". |
synchronized void addImageFromMemory | ( | 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.
This function behaves like addImageFromMemory2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use addImageFromMemory2() with a meaningful description of the image.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aData | The blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Image height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
synchronized void addImageFromMemory2 | ( | int | aTargetPage, |
byte[] | aData, | ||
double | aZoom, | ||
double | aX, | ||
double | aY, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags, | ||
String | aDescription, | ||
String | aLang | ||
) | throws SignDocException |
Add an image (from a blob) to a page (with alternate description).
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aTargetPage | The 1-based number of the page. |
[in] | aData | The blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aX | The X coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aY | The Y coordinate of the point at which the lower left corner of the image shall be placed. |
[in] | aWidth | Image width (document coordinates) or zero. The image will be scaled to this width. If this argument is non-zero, aZoom must be zero and either aHeight must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aHeight | Image height (document coordinates) or zero. The image will be scaled to this height. If this argument is non-zero, aZoom must be zero and either aWidth must be non-zero or ii_keep_aspect_ratio must be set in aFlags. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
[in] | aDescription | Alternate description for the image. If this value is null or an empty string, aLang will be ignored. If this value is null or an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used. |
[in] | aLang | Language identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US". |
synchronized void 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.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aWidth | The width of the page (in 1/72 inches for PDF documents). |
[in] | aHeight | The height of the page (in 1/72 inches for PDF documents). |
synchronized void 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
or
to save the signed document in that case.
If string parameter "OutputPath" is set to the special value "<memory>" for a PDF document, it will be saved to memory and signed in memory. You'll have to save the document as described in the preceding paragraph.
Some document types may allow adding signatures only if all signatures of the documents are valid.
For PDF documents, this function either signs or certifies the document, see integer parameter DocMDP.
If you are using RFC 3161 timestamps and get an exception with error code rc_unexpected_error and a message like "Contents overflow: xxx vs. yyy", try using a bigger value for integer parameter "TimeStampSize".
This function performs a basic verification of the signature after signing a PDF document unless siff_dont_verify_after_signing is set. This ensures that the private key matches the certificate. If that verification fails, SignDocInvalidSignatureException will be thrown.
[in] | aSignatureParameters | The signing parameters. The parameters can be used only once, for a single signature. |
[in] | aVerificationParameters | Verification parameters or null for default parameters. If revocation checking is enabled in aVerificationParameters, the revocation state of the certificates (subject to integer parameter "VerificationModel") in both the signing certificate's certificate chain and (if RFC 3161 time stamps are enabled) the RFC 3161 time stamp's certificate chain is checked. These verification parameters are not used for verifying the certificate chain of HTTPS connections to RFC 3161 time-stamp servers. |
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.
This function behaves like addText2() with an empty string for aLang.
Multiple lines are not supported, the text must not contain CR and LF characters.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aText | The text. Complex scripts are supported, see Complex Scripts. Escape sequences must not be used. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX | The X coordinate of the reference point of the visually left-most character in document coordinates. |
[in] | aY | The Y coordinate of the reference point of the visually left-most character in document coordinates. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aTextColor | The text color. |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0. |
[in] | aFlags | Must be 0. |
synchronized void addText2 | ( | String | aText, |
int | aPage, | ||
double | aX, | ||
double | aY, | ||
String | aFontName, | ||
double | aFontSize, | ||
SignDocColor | aTextColor, | ||
double | aOpacity, | ||
int | aFlags, | ||
String | aLang | ||
) | throws SignDocException |
Add text to a page (with language identifier).
Multiple lines are not supported, the text must not contain CR and LF characters.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aText | The text. Complex scripts are supported, see Complex Scripts. Escape sequences must not be used. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX | The X coordinate of the reference point of the visually left-most character in document coordinates. |
[in] | aY | The Y coordinate of the reference point of the visually left-most character in document coordinates. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aTextColor | The text color. |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0. |
[in] | aFlags | Must be 0. |
[in] | aLang | Language identifier for aText, either an RFC 3066 language tag (example: "en-US") or an empty string or null. If a PDF/UA document does not specify a natural language, a language identifier is required. If a language identifier is required and aLang is an empty string or null, the behavior depends on flag f_require_lang:
|
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).
This function behaves like addTextRect2() with an empty string for aLang.
The interpretation of CR and LF in the text depends on the value of aFlags, see atrf_compat.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aText | The text. The interpretation of CR and LF depends on the value of aFlags. Escape sequences must not be used. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX0 | X coordinate of lower left corner. |
[in] | aY0 | Y coordinate of lower left corner. |
[in] | aX1 | X coordinate of upper right corner. |
[in] | aY1 | Y coordinate of upper right corner. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aLineSkip | The vertical distance between the baselines of successive lines (usually 1.2 * aFontSize). |
[in] | aTextColor | The text color. |
[in] | aHAlignment | Horizontal alignment of the text (ha_left, ha_center, ha_right, or ha_auto). |
[in] | aVAlignment | Vertical alignment of the text (va_top, va_center, or va_bottom). |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0. |
[in] | aFlags | Flags modifying the behavior of this function, see atrf_compat, atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl. |
synchronized void addTextRect2 | ( | 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, | ||
String | aLang | ||
) | throws SignDocException |
Add text in a rectangle of a page (with line breaking and language identifier).
The interpretation of CR and LF in the text depends on the value of aFlags, see atrf_compat.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aText | The text. The interpretation of CR and LF depends on the value of aFlags. Escape sequences must not be used. |
[in] | aPage | The 1-based page number of the page. |
[in] | aX0 | X coordinate of lower left corner. |
[in] | aY0 | Y coordinate of lower left corner. |
[in] | aX1 | X coordinate of upper right corner. |
[in] | aY1 | Y coordinate of upper right corner. |
[in] | aFontName | The font name. This can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file. |
[in] | aFontSize | The font size (in user space units). |
[in] | aLineSkip | The vertical distance between the baselines of successive lines (usually 1.2 * aFontSize). |
[in] | aTextColor | The text color. |
[in] | aHAlignment | Horizontal alignment of the text (ha_left, ha_center, ha_right, or ha_auto). |
[in] | aVAlignment | Vertical alignment of the text (va_top, va_center, or va_bottom). |
[in] | aOpacity | The opacity, 0.0 (transparent) through 1.0 (opaque). Documents conforming to PDF/A-1 must use an opacity of 1.0. |
[in] | aFlags | Flags modifying the behavior of this function, see atrf_compat, atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl. |
[in] | aLang | Language identifier for aText, either an RFC 3066 language tag (example: "en-US") or an empty string or null. If a PDF/UA document does not specify a natural language, a language identifier is required. If a language identifier is required and aLang is an empty string or null, the behavior depends on flag f_require_lang:
|
synchronized void addWatermark | ( | SignDocWatermark | aInput | ) | throws SignDocException |
Add a watermark.
[in] | aInput | An object describing the watermark. |
synchronized void applyFdf | ( | String | aPath, |
int | aFlags | ||
) | throws SignDocException |
Apply an FDF document to a PDF document.
FDF documents can be applied to PDF documents only.
[in] | aPath | The pathname of the FDF document. |
[in] | aFlags | Flags modifying the behavior of this function, see sff_keep_ap, sff_update_ap, sff_fit_height_only, sff_force_border_width, sff_dont_break_lines, sff_auto_alignment, sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl. |
synchronized void changeAttachmentDescription | ( | String | aName, |
String | aDescription | ||
) | throws SignDocException |
Change the description of an attachment of the document.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
[in] | aDescription | The new description of the attachment (can be null and empty). |
synchronized int checkAttachment | ( | String | aName | ) | throws SignDocException |
Check the checksum of an attachment.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
synchronized void clearAllSignatures | ( | ) | throws SignDocException |
Remove all signatures of the document.
This includes any certification signature, see removeDocMDP().
synchronized void clearApprovalSignatures | ( | ) | throws SignDocException |
Remove all approval signatures of the document.
synchronized void 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).
[in] | aFieldName | The name of the signature field. |
synchronized void close | ( | ) |
Close the document and the underlying file and destroy the underlying native object (for java.lang.AutoCloseable).
After calling this method, all methods but close() will throw SignDocUnexpectedErrorException.
synchronized double computeZoom | ( | SignDocRenderParameters | aParams | ) | throws SignDocException |
Compute the zoom factor used for rendering.
If integer parameter "Height" or "Width" of aParams has been set, the actual factor depends on the document's page size. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the maximum width and maximum height of all selected pages will be used.
See also "Scale" of SignDocRenderParameters.setNumber().
[in] | aParams | The parameters such as the page number and the zoom factor. |
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 specified page.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.
Suppose the specified page of a PDF document is not rotated and has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,PH) and point (0,IH-1) will be converted to (0,0).
[in,out] | aPoint | The point to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
synchronized Rect convImageRectToPageRect | ( | SignDocImageRect | aInput, |
SignDocRenderParameters | aParams | ||
) | throws SignDocException |
Convert a rectangle expressed in canvas (image) coordinates to a rectangle expressed in document coordinate system of the specified page.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.
Suppose the specified page of a PDF document is not rotated and has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,PH) and point (0,IH-1) will be converted to (0,0).
[in] | aInput | The rectangle to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
synchronized void convPagePointToCanvasPoint | ( | Point | aPoint, |
SignDocRenderParameters | aParams | ||
) | throws SignDocException |
Convert a point expressed in document coordinate system of the specified page to a point expressed in canvas (image) coordinates.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.
Suppose the specified page of a PDF document is not rotated and has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,IH-1) and point (0,PH) will be converted to (0,0).
[in,out] | aPoint | The point to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
synchronized SignDocImageRect convPageRectToImageRect | ( | Rect | aInput, |
SignDocRenderParameters | aParams | ||
) | throws SignDocException |
Convert a rectangle expressed in document coordinate system of the specified page to a rectangle expressed in canvas (image) coordinates.
The origin is in the bottom left corner of the page. The origin is in the upper left corner of the image. See Coordinate Systems. If multiple pages are selected (integer parameters "FirstPage" and "LastPage" of aParams), the first page of the range will be used.
Suppose the specified page of a PDF document is not rotated and has height PH and the rendered image has height IH. Then, point (0,0) will be converted to (0,IH-1) and point (0,PH) will be converted to (0,0).
[in] | aInput | The rectangle to be converted. |
[in] | aParams | The parameters such as the page number and the zoom factor. |
synchronized byte [] copyAsSignedToMemory | ( | String | aFieldName | ) | throws SignDocException |
Copy the document to a blob for viewing the document "as signed".
This function copies to a blob the document as it was when the specified signature field was signed. If the specified signature field contains the last signature applied to the document, this function is equivalent to copyToMemory(). However, for some document formats, this function may require signatures to be valid.
[in] | aFieldName | The name of the signature field. |
synchronized void 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.
[in] | aStream | The document will be copied to this stream. |
[in] | aFieldName | The name of the signature field. |
synchronized byte [] copyToMemory | ( | int | aFlags | ) | throws SignDocException |
Copy the document's current status or backing file or backing blob to a blob.
If ctsf_unsaved is not set in aFlags , this function will copy to a blob the file or blob from which the document was loaded or to which the document was most recently saved. Changes made to the in-memory copy of the document since it was loaded or saved will not be reflected in the copy written to the blob.
If 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 blob.
This function does not have side effects on the in-memory copy of the document, that is, unsaved changes remain unsaved (except for being saved to the blob if ctsf_unsaved is set in aFlags).
[in] | aFlags | Flags modifying the behavior of this function, see ctsf_unsaved. |
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.
If ctsf_unsaved is not set in aFlags , this function will copy to a stream the file or blob from which the document was loaded or to which the document was most recently saved. Changes made to the in-memory copy of the document since it was loaded or saved will not be reflected in the copy written to the stream.
If ctsf_unsaved is set in aFlags, unsaved changes made to the in-memory copy of the document will be included (as incremental update for PDF documents) in the stream.
This function does not have side effects on the in-memory copy of the document, that is, unsaved changes remain unsaved (except for being saved to the stream if ctsf_unsaved is set in aFlags).
[in] | aStream | The document will be copied to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, see ctsf_unsaved. |
synchronized SignDocAnnotation createFreeTextAnnotation | ( | Point | aLowerLeft, |
Point | aUpperRight | ||
) | throws SignDocException |
Create a text annotation.
See SignDocAnnotation for details.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aLowerLeft | coordinates of lower left corner. |
[in] | aUpperRight | coordinates of upper right corner. |
synchronized SignDocAnnotation 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.
[in] | aX0 | X coordinate of lower left corner. |
[in] | aY0 | Y coordinate of lower left corner. |
[in] | aX1 | X coordinate of upper right corner. |
[in] | aY1 | Y coordinate of upper right corner. |
synchronized SignDocAnnotation createLineAnnotation | ( | Point | aStart, |
Point | aEnd | ||
) | throws SignDocException |
Create a line annotation.
See SignDocAnnotation for details.
This function uses document (page) coordinates, see Coordinate Systems.
[in] | aStart | Start point. |
[in] | aEnd | End point. |
synchronized SignDocAnnotation 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.
[in] | aStartX | X coordinate of start point. |
[in] | aStartY | Y coordinate of start point. |
[in] | aEndX | X coordinate of end point. |
[in] | aEndY | Y coordinate of end point. |
synchronized SignDocAnnotation createScribbleAnnotation | ( | ) | throws SignDocException |
synchronized SignDocSignatureParameters 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:
Profile | Document Types | Description |
---|---|---|
"" | PDF, TIFF | Image above Signer and SignTime |
"image" | PDF, TIFF | Image only |
For TIFF documents, "" produces the same output as "image".
Profile "" is defined by this template:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE SignatureTemplate SYSTEM "SignatureTemplate.dtd"> <SignatureTemplate text-halignment="center" text-valignment="bottom" image-halignment="center" image-valignment="top" image-transparency="brightest" text-position="below" font-size="0.1 h" text-hmargin="0.1 h" image-margin="1"> <Line item="Signer"/> <Line item="SignTime"/> </SignatureTemplate>
Profile "image" is defined by this template:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE SignatureTemplate SYSTEM "SignatureTemplate.dtd"> <SignatureTemplate text-halignment="center" text-valignment="center" image-halignment="center" image-valignment="center" image-transparency="brightest" text-position="overlay" font-size="0.1 h" text-hmargin="0.1 h" image-margin="1"> </SignatureTemplate>
[in] | aFieldName | The name of the signature field. |
[in] | aProfile | The profile name. Some document types and signature fields support different sets of default parameters. The default profile, "", is supported for all signature fields. |
synchronized SignDocSignatureParameters createSignatureParametersForTimeStamp | ( | ) | throws SignDocException |
Create a SignDocSignatureParameters object for adding a document time stamp.
Each SignDocSignatureParameters object should be used for at most one signature.
synchronized SignDocTextIterator createTextIterator | ( | int | aFirstPage, |
int | aLastPage, | ||
int | aFlags | ||
) | throws SignDocException |
Create an iterator that visits all the text of a range of pages.
Text will be returned in the sequence encountered when reading the content streams of the document sequentially.
This function is implemented for PDF documents only.
[in] | aFirstPage | 1-based number of first page to be visited. |
[in] | aLastPage | 1-based number of last page to be visited or 0 for all pages to the end of the document. |
[in] | aFlags | Flags modifying the behavior of this function, must be 0. |
synchronized void exportFields | ( | java.io.OutputStream | aStream, |
int | aFlags | ||
) | throws SignDocException |
Export all fields as XML to a stream.
This function always uses UTF-8 encoding. The output conforms to schema PdfFields.xsd.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aStream | The fields will be saved to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, See e_top. |
synchronized byte [] exportFieldsToMemory | ( | int | aFlags | ) | throws SignDocException |
Export all fields as XML to a blob.
This function always uses UTF-8 encoding. The output conforms to schema PdfFields.xsd.
There is a setFlags() flag modifying the behavior of this function: f_ambiguous_button_value_empty.
[in] | aFlags | Flags modifying the behavior of this function, See e_top. |
synchronized void exportProperties | ( | String | aCollection, |
java.io.OutputStream | aStream, | ||
int | aFlags | ||
) | throws SignDocException |
Export properties as XML to a stream.
This function always uses UTF-8 encoding. The output conforms to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, all properties of the "public" and "encrypted" collections will be exported. |
[in] | aStream | The properties will be saved to this stream. |
[in] | aFlags | Flags modifying the behavior of this function, See e_top. |
synchronized byte [] exportPropertiesToMemory | ( | String | aCollection, |
int | aFlags | ||
) | throws SignDocException |
Export properties as XML to a blob.
This function always uses UTF-8 encoding. The output conforms to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, all properties of the "public" and "encrypted" collections will be exported. |
[in] | aFlags | Flags modifying the behavior of this function, See e_top. |
|
protected |
Finalize this object.
Do not call this method unless you know what you are doing.
synchronized SignDocFindTextOccurrence [] findText | ( | int | aFirstPage, |
int | aLastPage, | ||
String | aText, | ||
int | aFlags | ||
) | throws SignDocException |
Find text.
The text of the document will be scanned in the sequence encountered when reading the content streams of the document sequentially.
This function is implemented for PDF documents only.
[in] | aFirstPage | 1-based number of first page to be searched. |
[in] | aLastPage | 1-based number of last page to be searched or 0 to search to the end of the document. |
[in] | aText | Text to be searched for. Multiple successive spaces are treated as single space (and may be ignored subject to aFlags). |
[in] | aFlags | Flags modifying the behavior of this function, see ftf_ignore_hspace, ftf_ignore_hyphenation, and ftf_ignore_sequence. |
synchronized void flattenAnnotations | ( | int | aFirstPage, |
int | aLastPage, | ||
int | aFlags | ||
) | throws SignDocException |
Flatten all annotations of the document or of a range of pages.
Flattening an annotation of a PDF document makes its appearance part of the page and removes the selected annotation or all annotations. This function selects all non-widget annotations on the specified pages, ie, it does not flatten fields.
Flattening annotations breaks existing signatures. If you are flattening annotations only for printing with PDF components that don't support annotations, make a copy of the document, pass
to setShootInFoot(), flatten the annotations, print the document, and throw it away.
[in] | aFirstPage | 1-based number of first page. |
[in] | aLastPage | 1-based number of last page or 0 to process all pages to the end of the document. |
[in] | aFlags | Flags modifying the behavior of this function, see faf_include_hidden and faf_keep_structure. |
synchronized void 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
to setShootInFoot(), flatten the fields, print the document, and throw it away.
[in] | aName | The fully-qualified name of the field. |
[in] | aWidget | The widget index to flatten only one widget or -1 to flatten all widgets. |
synchronized void 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
to setShootInFoot(), flatten the fields, print the document, and throw it away.
[in] | aFirstPage | 1-based number of first page. |
[in] | aLastPage | 1-based number of last page or 0 to process all pages to the end of the document. |
[in] | aFlags | Flags modifying the behavior of this function, see 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. |
synchronized SignDocAnnotation getAnnotation | ( | int | aPage, |
String | aName | ||
) | throws SignDocException |
Get a named annotation of a page.
All setters will fail for the returned object.
[in] | aPage | The page number (1 for the first page). |
[in] | aName | The name of the annotation. |
synchronized String [] getAnnotations | ( | int | aPage | ) | throws SignDocException |
Get a list of all named annotations of a page.
Unnamed annotations are ignored by this function.
[in] | aPage | The page number (1 for the first page). |
synchronized SignDocAttachment getAttachment | ( | String | aName | ) | throws SignDocException |
Get information about an attachment.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
synchronized byte [] getAttachmentBlob | ( | String | aName | ) | throws SignDocException |
Get an attachment as blob.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
synchronized String [] getAttachments | ( | ) | throws SignDocException |
Get a list of all attachments of the document.
Attachments are supported for PDF documents only.
synchronized java.io.InputStream getAttachmentStream | ( | String | aName | ) | throws SignDocException |
Get an InputStream for an attachment.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
synchronized int 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.
synchronized int 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.
[in] | aPage | The page number (1 for the first page). |
synchronized boolean 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
synchronized double 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(). For PDF documents, this function now always returns 72 as UserUnit is taken into account automatically.
See Coordinate Systems.
[in] | aPage | The page number (1 for the first page). |
synchronized double 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(). For PDF documents, this function now always returns 72 as UserUnit is taken into account automatically.
See Coordinate Systems.
[in] | aPage | The page number (1 for the first page). |
synchronized int getDocMDP | ( | ) | throws SignDocException |
Get the DocMDP P value of the document's certification signature.
The DocMDP P value of the certification signature specifies what modifications to the document are allowed.
This function does not verify the certification signature.
synchronized String getDocumentLanguage | ( | ) | throws SignDocException |
Get the document's natural language.
That language applies to all text unless overridden locally.
synchronized SignDocField 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.
[in] | aName | The fully-qualified name of the field. |
synchronized SignDocField [] 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.
[in] | aTypes | 0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is SignDocField.t_text, etc. |
synchronized SignDocField [] 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.
[in] | aPage | The 1-based page number. |
[in] | aTypes | 0 to get fields of all types. Otherwise, a bitset selecting the field types to be included. To include a field of type t, add 1<<t, where t is SignDocField.t_text, etc. |
synchronized int getFlags | ( | ) | throws SignDocException |
synchronized int 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
synchronized String 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.
synchronized int getLockMDP | ( | ) | throws SignDocException |
Get the lowest lock MDP value of the signed signature fields.
The lock MDP value specifies what modifications to the document are allowed.
This function does not verify any signature.
synchronized int getPageCount | ( | ) | throws SignDocException |
synchronized double getPageHeight | ( | int | aPage | ) | throws SignDocException |
Get the height of a page.
Different pages of the document may have different sizes.
[in] | aPage | The page number (1 for the first page). |
synchronized String getPageLabel | ( | int | aPage | ) | throws SignDocException |
Get the page label for a page number.
For TIFF documents, aPage will be converted to a decimal number.
[in] | aPage | The page number (1 for the first page). |
synchronized double getPageWidth | ( | int | aPage | ) | throws SignDocException |
Get the width of a page.
Different pages of the document may have different sizes.
[in] | aPage | The page number (1 for the first page). |
synchronized String 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.
synchronized String [] getProfiles | ( | String | aFieldName | ) | throws SignDocException |
Get a list of profiles for a signature field.
[in] | aFieldName | The name of the signature field. |
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.
Use getBooleanProperty(), getIntegerProperty(), or getStringProperty() to get the values of the properties.
There are two collections of SignDoc document properties:
Using the same property name in the "encrypted" and "public" collections is not possible. Attempts to get, set, or remove a property in the wrong collection will fail with error code rc_wrong_collection. To move a property from one collection to another collection, first remove it from the source collection, then add it to the target collection.
The "pdfa" and "pdfua" collections are read-only and a property name existing in those collections does not prevent that property name from appearing in one of the other collections.
The syntax of property names depends on the document type and the collection containing the property.
"public" properties of PDF documents are stored according to XMP in namespace "http://www.softpro.de/pdfa/signdoc/public/", therefore property names must be valid unqualified XML names, see the syntax of "Name" in the XML 1.1 specification at http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-common-syn (section 2.3 Common Syntactic Constructs).
For "encrypted" properties and any properties in TIFF documents, property names can contain arbitrary Unicode characters except for NUL.
[in] | aCollection | The name of the collection, see above. |
synchronized SignDocRenderOutput getRenderedSize | ( | 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 (integer parameters "FirstPage" and "LastPage" of aParams), the maximum width and maximum height of all selected pages will be used.
[in] | aParams | Parameters such as the page number. |
synchronized int 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).
synchronized double 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.
See Coordinate Systems.
[in] | aPage | The page number (1 for the first page). |
synchronized double 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.
See Coordinate Systems.
[in] | aPage | The page number (1 for the first page). |
synchronized int 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 PDF/A-1 conformance.
synchronized int getSaveToStreamFlags | ( | ) | throws SignDocException |
Get all flags currently valid for saveToStream() and saveToMemory().
sf_pdfa_buttons is returned only if the document claims PDF/A-1 conformance.
synchronized int getShootInFoot | ( | ) | throws SignDocException |
Get the flags set by setShootInFoot().
synchronized SignDocSignature getSignature | ( | int | aIndex | ) | throws SignDocException |
Get a signature of the document.
By passing values for aIndex from 0 up to getSignatureCount()-1, the history of changes to the document can be obtained. Exception: If clearSignature() has been called for a TIFF document, the order of signatures is indeterminate.
[in] | aIndex | The index of the signature, 0 for the first signature applied to the document, getSignatureCount()-1 for the newest signature. |
synchronized int getSignatureCount | ( | ) | throws SignDocException |
Get the number of signatures that can be retrieved with getSignature().
synchronized String 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
synchronized SignDocTextFieldAttributes getTextFieldAttributes | ( | ) | throws SignDocException |
Get the document's default text field attributes.
synchronized int getType | ( | ) | throws SignDocException |
Get the type of the 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.
This function behaves like importPageFromImageBlob2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use importPageFromImageBlob2() with a meaningful description of the image.
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aData | The blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
synchronized void importPageFromImageBlob2 | ( | int | aTargetPage, |
byte[] | aData, | ||
double | aZoom, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags, | ||
String | aDescription, | ||
String | aLang | ||
) | throws SignDocException |
Import a page from a blob containing an image (with alternate description).
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aData | The blob containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
[in] | aDescription | Alternate description for the image. If this value is null or an empty string, aLang will be ignored. If this value is null or an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used. |
[in] | aLang | Language identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US". |
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.
This function behaves like importPageFromImageFile2() with an empty string for aDescription, that is, if the document uses Tagged PDF, a dummy alternate description for the image ("image" with language code "en") will provided to avoid breaking standard compliance. It is strongly recommended to use importPageFromImageFile2() with a meaningful description of the image.
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
synchronized void importPageFromImageFile2 | ( | int | aTargetPage, |
String | aPath, | ||
double | aZoom, | ||
double | aWidth, | ||
double | aHeight, | ||
int | aFlags, | ||
String | aDescription, | ||
String | aLang | ||
) | throws SignDocException |
Import a page from a file containing an image (with alternate description).
This function is currently implemented for PDF documents only.
[in] | aTargetPage | The 1-based number of the page before which to insert the new page. The page will be appended if this value is 0. |
[in] | aPath | The pathname of the file containing the image. Supported formats for inserting into PDF documents are: JPEG, PNG, GIF, TIFF, and BMP. |
[in] | aZoom | Zoom factor or zero. If this argument is non-zero, aWidth and aHeight must be zero. The size of the page is computed from the image size and resolution, multiplied by aZoom. |
[in] | aWidth | Page width (document coordinates) or zero. If this argument is non-zero, aHeight must also be non-zero and aZoom must be zero. The image will be scaled to this width. |
[in] | aHeight | Page height (document coordinates) or zero. If this argument is non-zero, aWidth must also be non-zero and aZoom must be zero. The image will be scaled to this height. |
[in] | aFlags | Flags modifying the behavior of this function, See ii_keep_aspect_ratio. ii_keep_aspect_ratio is not needed if aZoom is non-zero. |
[in] | aDescription | Alternate description for the image. If this value is null or an empty string, aLang will be ignored. If this value is null or an empty string and the document uses Tagged PDF, "image" with language code "en" will be used to avoid breaking standard compliance. It is strongly recommended to use a meaningful description. Escape sequences must not be used. |
[in] | aLang | Language identifier for aDescription. Unless aDescription is an empty string, this must be a string containing an RFC 3066 language tag. Example: "en-US". |
synchronized void 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.
Unles flag siff_allow_breaking_tagged_pdf is set, this function may fail for some values of aTargetPage as the target structure may not be suitable for insertion of pages between certain pages. Appending pages after the last page should always work.
[in] | aTargetPage | The 1-based number of the page before which to insert the copied pages. The pages will be appended if this value is 0. |
[in] | aSource | The document from which to copy the pages. aSource can be this. |
[in] | aSourcePage | The 1-based number of the first page (in the source document) to be copied. |
[in] | aPageCount | The number of pages to be copied. All pages of aSource starting with aSourcePage will be copied if this value is 0. |
[in] | aFlags | Must be zero. |
synchronized void importProperties | ( | String | aCollection, |
java.io.InputStream | aStream, | ||
int | aFlags | ||
) | throws SignDocException |
Import properties from XML (reading a stream).
The input must conform to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, properties will be imported into all collections, otherwise properties will be imported into the specified collection. |
[in] | aStream | The properties will be read from this stream. This function reads the input completely, it doesn't stop at the end tag. |
[in] | aFlags | Flags modifying the behavior of this function, See i_atomic. |
synchronized void importPropertiesFromMemory | ( | String | aCollection, |
byte[] | aBlob, | ||
int | aFlags | ||
) | throws SignDocException |
Import properties from XML (reading memory).
The input must conform to schema AllSignDocProperties.xsd (if aCollection is empty) or SignDocProperties.xsd (if aCollection is non-empty).
[in] | aCollection | The name of the collection, see getProperties(). If the string is empty, properties will be imported into all collections, otherwise properties will be imported into the specified collection. |
[in] | aBlob | The properties will be read from this blob. |
[in] | aFlags | Flags modifying the behavior of this function, See i_atomic. |
synchronized boolean isModified | ( | ) | throws SignDocException |
Check if the document has unsaved changes.
synchronized boolean isTaggedPDF | ( | ) | throws SignDocException |
Check if the document is a Tagged PDF document.
synchronized void removeAnnotation | ( | int | aPage, |
String | aName | ||
) | throws SignDocException |
Remove an annotation identified by name.
[in] | aPage | The page number (1 for the first page). |
[in] | aName | The name of the annotation, must not be empty. |
synchronized void removeAttachment | ( | String | aName | ) | throws SignDocException |
Remove an attachment from the document.
Attachments are supported for PDF documents only.
[in] | aName | The name of the attachment. |
synchronized void removeDocMDP | ( | ) | throws SignDocException |
Remove any certification signature.
This function does nothing for TIFF documents as TIFF documents do not have certification signatures.
synchronized void removeField | ( | String | aName | ) | throws SignDocException |
Remove a field.
Removing a field of a TIFF document will invalidate all signatures.
[in] | aName | The fully-qualified name of the field. |
synchronized void removeLogicalStructure | ( | int | aFlags | ) | throws SignDocException |
Remove the logical structure.
This function is available for PDF documents only.
[in] | aFlags | Must be 0. |
synchronized void 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.
[in] | aPages | One-based page numbers of pages to be removed. The order does not matter, neither does the number of occurences of a page number. |
[in] | aMode | Tell this function whether to keep (kor_keep) or to remove (kor_remove) the pages specified by aPages. |
synchronized void 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.
[in] | aFlags | Must be 0. |
synchronized void removePDFUA | ( | int | aFlags | ) | throws SignDocException |
Remove PDF/UA conformance.
Some operations on PDF documents (such as using standard fonts) are not allowed in PDF/UA documents. This function turns a PDF/UA document into a plain document, enabling those operations.
This function is available for PDF documents only.
[in] | aFlags | Must be 0. |
synchronized void 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.
[in] | aFlags | Must be 0. |
synchronized void 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
synchronized void removeXFA | ( | int | aFlags | ) | throws SignDocException |
Remove XFA (XML Forms Architecture) content.
SignDoc SDK does not support XFA (XML Forms Architecture) and therefore addSignature(), addField(), applyFdf(), and setField() remove XFA from the document to avoid descrepancies between "classic" form fields and XFA. This function is available for PDF documents only.
You can also remove XFA content by calling this function. It will fail if the document prohibits removal of XFA (removing XFA from signed documents breaks signatures).
This function is available for PDF documents only.
[in] | aFlags | Must be 0. |
synchronized byte [] renderPageAsImage | ( | SignDocRenderOutput | aOutput, |
SignDocRenderParameters | aRenderParameters, | ||
SignDocVerificationParameters | aVerificationParameters, | ||
Rect | aClipRect | ||
) | throws SignDocException |
Render the selected page (or pages) as image.
[out] | aOutput | The image size will be stored here. |
[in] | aRenderParameters | Parameters such as the page number. |
[in] | aVerificationParameters | Parameters for verification of signatures. Used only if boolean parameter "AddDecorations" of aRnderParameters has been set to true. Currently, signatures are verified one after another and the "Timeout" integer parameter applies to each verification. Pass null for default parameters. |
[in] | aClipRect | The rectangle to be rendered (using document coordinates, see Coordinate Systems) or null to render the complete page. |
synchronized SignDocImage renderPageAsSignDocImage | ( | SignDocRenderOutput | aOutput, |
SignDocRenderParameters | aRenderParameters, | ||
SignDocVerificationParameters | aVerificationParameters, | ||
Rect | aClipRect | ||
) | throws SignDocException |
Render the selected page as SignDocImage object.
Only a single page can be rendered.
[out] | aOutput | The image size will be stored here. |
[in] | aRenderParameters | Parameters such as the page number. |
[in] | aVerificationParameters | Parameters for verification of signatures. Used only if boolean parameter "AddDecorations" of aRnderParameters has been set to true. Currently, signatures are verified one after another and the "Timeout" integer parameter applies to each verification. Pass null for default parameters. |
[in] | aClipRect | The rectangle to be rendered (using document coordinates, see Coordinate Systems) or null to render the complete page. |
synchronized void 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 unless sf_auto_incremental is also set. See also getRequiredSaveToFileFlags().
The file will remain open until the document is saved again or the SignDocDocument object is closed or destroyed.
[in] | aPath | The pathname of the file to be created or overwritten. Pass null to save to the file from which the document was loaded or most recently saved (which will fail if the documment was loaded from memory or saved to a stream). |
[in] | aFlags | Set of flags (sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused, and sf_auto_incremental, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. Which flags are required depends on the document state. Call getRequiredSaveToFileFlags() to get the flags that are required. |
synchronized byte [] saveToMemory | ( | int | aFlags | ) | throws SignDocException |
Save the document to a blob.
This function may have side effects on the document such as marking it as not modified which may render sf_incremental useless for the next saveToFile() call unless the document is changed between those two calls.
After calling this function, the document will be backed by memory.
[in] | aFlags | Set of flags (sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused, and sf_auto_incremental, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. |
synchronized void 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.
After calling this function successfull, the document will be backed by memory.
[in] | aStream | The document will be saved to this stream. |
[in] | aFlags | Set of flags (sf_incremental, sf_linearized, sf_pdf_1_4, sf_pdfa_buttons, sf_remove_unused, and sf_auto_incremental, combined with `|') modifying the behavior of this function. Pass 0 for no flags. Which flags are available depends on the document type. |
synchronized void 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
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.
No features introduced after aMajor.aMinor will be used.
Passing a version number before 1.11 or after the current version will fail.
[in] | aMajor | Major version number. |
[in] | aMinor | Minor version number. |
synchronized void 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.
[in] | aLevel | The 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 setDefaultDocumentLanguage | ( | String | aLang | ) | throws SignDocException |
Set the language identifier to be used if a language identifier is required but the document doesn't provide one.
If this function is not called, "en" will be used.
This function is available for PDF documents only.
[in] | aLang | An RFC 3066 language tag. Must not be an empty string. Example: "en-US". |
synchronized void setDocumentLanguage | ( | String | aLang | ) | throws SignDocException |
Set the document's natural language.
That language applies to all text unless overridden locally.
This function is available for PDF documents only.
[in] | aLang | The natural language for the document (an RFC 3066 language tag). Must be neither null nor an empty string. Example: "en-US". |
synchronized void 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().
Applications should not call setField() for fields that are locked, ie, have SignDocField.f_ReadOnly set in the return value of SignDocField.getFlags(). However, setField() does not fail in that case.
The coordinates of the field are not changed unless sff_move is set in aFlags.
Do not try to build a SignDocField object from scratch for changing a field as future versions of the SignDocField class may have additional attributes.
This function is implemented for PDF documents only.
This function always fails for PDF documents that have signed signature fields.
[in,out] | aField | The field to be changed. The font resource name of the default text field attributes may be modified. The value index and the value may be modified for radio button fields and check box fields. |
[in] | aFlags | Set of flags (sff_move, sff_keep_ap, sff_update_ap, sff_fit_height_only, sff_force_border_width, sff_dont_break_lines, sff_auto_alignment, sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl) combined with `|' modifying the behavior of this function. Pass 0 for no flags. |
synchronized void setFlags | ( | int | aFlags | ) | throws SignDocException |
Set flags modifying the behavior of various functions.
The default is value is 0.
[in] | aFlags | New set of flags, see f_relax_byte_range, f_ambiguous_button_value_empty, f_use_dss_only, f_no_kerning_for_standard_fonts, f_keep_escape_sequences, and f_no_actual_text. |
synchronized void 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
synchronized void 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.
synchronized void 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.
[in] | aCollection | The name of the collection, see getProperties(). |
[in] | aName | The name of the property. |
[in] | aValue | The new value of the property. |
synchronized void 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.
[in,out] | aData | The new default text field attributes. The font resource name will be updated. |
|
static |
Split a string obtained from a PDF text string into escape sequences and text segments.
You don't need to call this function unless flag f_keep_escape_sequences is set.
[in] | aInput | The input string. |
synchronized int updateDSS | ( | SignDocVerificationParameters | aParameters, |
int | aFlags | ||
) | throws SignDocException |
Update the DSS for any eligible signatures of the document.
This function is available for PDF documents only.
To extend the validity of the signatures in a PDF document (long term validity LTV), call this function, save the document incrementally, and add a document time stamp.
If the document already has a document time stamp, this function adds information for the latest document time stamp to the DSS. If the document does not have a document time stamp, this function adds information for all eligible signature fields to the DSS.
This function fails if verification fails for any of the signatures.
[in] | aParameters | Verification parameters or null for default parameters. |
[in] | aFlags | Flags modifying the behavior of this function, see udf_simulate and udf_vri. |
synchronized void updateDSS2 | ( | String | aFieldName, |
SignDocVerificationParameters | aParameters, | ||
int | aFlags | ||
) | throws SignDocException |
Update the DSS for a signature of the document.
The main purpose of this function is testing SignDoc SDK, please use updateDSS() instead.
This function is available for PDF documents only.
Call this function (possibly a long time) after signing field aFieldName, then save the document incrementally and add a document time stamp. Before applying the first document time stamp, this function should be called for all eligable signature fields. If any document time stamp has already been added, this function should be called for the last document time stamp.
The signature field must have been signed with one of these methods: SignDocSignatureParameters.m_digsig_pkcs7_detached, SignDocSignatureParameters.m_digsig_pkcs7_sha1, SignDocSignatureParameters.m_digsig_cades_detached, or SignDocSignatureParameters.m_digsig_cades_rfc3161.
This function does nothing if the signature field is not signed.
[in] | aFieldName | The name of the signature field. |
[in] | aParameters | Verification parameters or null for default parameters. |
[in] | aFlags | Flags modifying the behavior of this function, see udf_simulate and udf_vri. |
synchronized SignDocVerificationResult 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.
[in] | aFieldName | The name of the signature field. |
synchronized SignDocVerificationResult verifySignature2 | ( | SignDocSignature | aSignature | ) | throws SignDocException |
Verify a signature of the document.
These are the differences between calling this function and calling verifySignature() with the field name obtained from aSignature:
There is a setFlags() flag modifying the behavior of this function: f_relax_byte_range.
[in] | aSignature | A SignDocSignature object for this document. |
|
static |
Prepend an escape sequence for specifying the natural language in a text string.
This function throws an SignDocInvalidArgumentException if aLang is invalid.
[in] | aText | The text. |
[in] | aLang | Language identifier (an RFC3066 language tag with two-character language code and optional two-character country code). Only the language and the optional country will be used, the dash separating them will be removed. Example: "en-US" will prepend ESC "enUS" ESC. |
|
static |
Remove escape sequences specifying the natural language in text strings.
You don't need to call this function unless flag f_keep_escape_sequences is set.
[in] | aInput | The input string. |
|
static |
Flag for addTextRect(): Behave like addTextRect() of SignDoc SDK 4.2.0.8 and earlier.
If this flag is set, 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 (U+00A0) only:
Moreover, lines can be broken only at a space character (U+0020).
If this flag is not set, the rules of UAX #14 will be used. In particular, CR, LF, and CR LF start a new paragraph and lines can be broken after punctuation.
|
static |
Flag for addTextRect(): Choose direction automatically, default to LTR.
The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.
The paragraph level will be 0 (LTR) for paragraphs having no strong directional character.
If none of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl is set, atrf_ltr will be used.
At most one of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl can be set.
This flag will be ignored if atrf_compat is set.
|
static |
Flag for addTextRect(): Choose direction automatically, default to RTL.
The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.
The paragraph level will be 1 (RTL) for paragraphs having no strong directional character.
If none of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl is set, atrf_ltr will be used.
At most one of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl can be set.
This flag will be ignored if atrf_compat is set.
|
static |
Flag for addTextRect(): Paragraph direction: LTR.
If none of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl is set, atrf_ltr will be used.
At most one of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl can be set.
|
static |
Flag for addTextRect(): Paragraph direction: RTL.
If none of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl is set, atrf_ltr will be used.
At most one of atrf_ltr, atrf_rtl, atrf_default_ltr, and atrf_default_rtl can be set.
This flag will be ignored if atrf_compat is set.
|
static |
Return value for checkAttachment(): The attachment matches its checksum.
|
static |
Return value for checkAttachment(): The attachment does not match its checksum.
|
static |
Return value for checkAttachment(): The attachment does not have a checksum.
|
static |
Flag for copyToStream() and copyToMemory(): Include unsaved changes.
See copyToStream() and copyToMemory() for details.
|
static |
Document type: FDF document.
|
static |
Document type: Other document.
|
static |
Document type: PDF document.
|
static |
Document type: TIFF document.
|
static |
Document type: unknown, for SignDocDocumentLoader.ping().
|
static |
Flag for exportFields(), exportFieldsToMemory(), exportProperties(), and exportPropertiesToMemory(): Include XML declaration and schema for top-level element.
|
static |
Flag for setFlags(): Make exportFields(), exportFieldsToMemory(), 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.
|
static |
Flag for setFlags(): Fail if a new object cannot be inserted into the logical structure of the target document due to that logical structure being broken.
If this flag is not set and insertion into the logical structure fails due to that logical structure being broken, the logical structure will not be modified.
|
static |
Flag for setFlags(): Do not attempt to insert new objects into the logical structure in reading order.
If inserting in reading order fails or if this flag is set, new objects will be inserted at the end of the page's logical structure.
|
static |
Flag for setFlags(): Do not remove escape sequences specifying the natural language from text strings.
In PDF, text strings can contain escape sequences which specify the natural language (and optionally, the country) of the text. By default, those escape sequences are removed by functions like SignDocField.getAlternateName(). If this flag is set, those escape sequences are not removed.
If you serialize and deserialize a SignDocField object and this flag is not set, the escape sequences will get lost.
|
static |
Flag for setFlags(): Do not add Actualtext property to marked-content sequences.
This flag is used for testing.
If this flag is not set, ActualText is added when needed, ie, when the original text cannot be reconstructed by using ToUnicode.
|
static |
Flag for setFlags(): Disable kerning for standard fonts.
This flag is used for testing.
|
static |
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() and verifySignature2() 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.
|
static |
Flag for setFlags(): Require alternate field names.
If this flag is set and the document claims PDF/UA conformance, addField() will require an alternate field name to be set and setField() won't allow removal of the alternate field name (by setting it to an empty string). If a PDF/UA document does not specify a natural language, the alternate field name must start with an escape sequence specifying the language (see f_use_escape_sequences).
If this flag is not set and the document claims PDF/UA conformance, addField() will use the fully qualified field name as alternate field name. If the document does not provide a natural language, "en" (or the language set with setDefaultDocumentLanguage()) will be used. setField() behaves likewise if the alternate field name is removed (by setting it to an empty string). If a PDF/UA document does not specify a natural language and the alternate field name does not start with an escape sequence specifying the language, language identifier "en" (or the language set with setDefaultDocumentLanguage()) will be used (see f_use_escape_sequences).
|
static |
Flag for setFlags(): Require language identifier for text.
If this flag is set and the document claims PDF/UA conformance and does not provide a natural language, addText2() will fail unless a language identifier is passed in aLang and addText() will always fail.
If this flag is not set and the document claims PDF/UA conformance and does not provide a natural language, addText() and addText2() will use language identifier "en" (or the language set with setDefaultDocumentLanguage()) unless a language identifier is passed in aLang of addText2() or addTextRect2().
|
static |
Flag for setFlags(): Unused flag.
Formerly f_prevent_breaking_tagged_pdf, now ignored.
|
static |
Flag for setFlags(): Use only the Document Security Store for building the certificate chain and for checking the revocation state of the certificates, ignore any certificates, CRLs, and OCSP responses from the signature proper.
This flag is used for testing of verifySignature() and verifySignature2().
|
static |
Flag for setFlags(): Use escape sequences to encode the natural language in alternate field names.
If a natural language for an alternate field name is provided by the caller (by using an escape sequence) or if SignDoc SDK provides a default natural language for an alternate name, this flag controls how the natural language will be encoded in the document:
If this flag is set, the natural language will be encoded in the string, enabling different languages for the alternate field names of different fields. However, this is quite useless, as currently existing assistive technologies do not support escape sequences.
If this flag is not set and the document does provide a natural language, any escape sequences will be removed from the alternate field name.
If this flag is not set and the document does not provide a natrual language, the document's natural language will be set to the natural language of the alternate name.
|
static |
Flags modifying the behavior of flattenAnnotations(): Include hidden and invisible annotations.
|
static |
Flags modifying the behavior of flattenAnnotations(): 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 annotations just for printing with a PDF component that does not support annotations and then throw away the document with the flattened annotations.
|
static |
Flags modifying the behavior of flattenFields(): Include hidden and invisible widgets.
|
static |
Flags modifying the behavior of flattenFields(): Include signed signature fields.
|
static |
Flags modifying the behavior of flattenFields(): Include unsigned signature fields.
|
static |
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.
|
static |
Flag for findText(): Ignore horizontal whitespace (may be required).
If this flag is set, horizontal whitespace will be removed from the stream of characters read from the document (but not from the text being sought).
The following characters will be ignored:
|
static |
Flag for findText(): Ignore hyphenation.
If this flag is set, hyphen characters will be removed from the stream of characters read from the document (but not from the text being sought).
The following characters will be ignored:
|
static |
Flag for findText(): Use character positions instead of searching the characters in the document in the sequence they are encountered.
This can be expensive. This flag is not yet implemented.
|
static |
Horizontal alignment for addTextRect(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run.
|
static |
Horizontal alignment for addTextRect(): Center.
|
static |
Horizontal alignment for addTextRect(): Align left.
|
static |
Horizontal alignment for addTextRect(): Align right.
|
static |
Flag for importProperties() and importPropertiesFromMemory(): Modify all properties from XML or none (on error).
|
static |
Flag for addImageFromFile(), addImageFromFile2(), addImageFromMemory(), and addImageFromMemory2(): Make the brightest color transparent.
This flag may be specified for addImageFromFile(), addImageFromFile2(), addImageFromMemory(), and addImageFromMemory2() only. importPageFromImageBlob(), importPageFromImageBlob2(), importPageFromImageFile(), and importPageFromImageFile2() always make the image opaque.
The rest of this description applies to addImageFromFile(), addImageFromFile2(), addImageFromMemory(), and addImageFromMemory2() 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).
|
static |
Flag for addImageFromFile(), addImageFromFile2(), addImageFromMemory(), addImageFromMemory2(), importPageFromImageBlob(), importPageFromImageBlob2(), importPageFromImageFile(), and importPageFromImageFile2(): Keep aspect ratio of image, center image on white background.
|
static |
Tell removePages() to keep the specified pages.
Keep the specified pages, remove all other pages.
|
static |
Tell removePages() to remove the specified pages.
Remove the specified pages, keep all other pages.
|
static |
Save flag: Automatically set sf_incremental if needed, automatically reset sf_incremental if not allowed.
If this flag is set, SignDoc SDK will save the document incrementally or non-incrementally as needed; if you prefer saving incrementally, also set the sf_incremental flag. If you prefer saving non-incrementally, do not set the sf_incremental flag.
|
static |
Save flag: Save incrementally (PDF).
|
static |
Save flag: Linearize the document (PDF).
This flag cannot be used with sf_incremental.
|
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.
|
static |
Save flag: Fix appearance streams of check boxes and radio buttons for conformance with PDF/A-1 without Technical Corrigendum 2.
The appearance streams of a check box or radio button field added by addField() or modified by setField() or applyFdf() do not conform to ISO 19005-1:2005 before Technical Corrigendum 2 (TC2). The relevant wording was fixed in TC2.
To make the appearance streams of check boxes and radio buttons conform to ISO 19005-1:2005 before TC2, save the document with this flag set. The document will be modified in memory and then saved. The document will not conform to TC2 and later versions of ISO 19005.
This flag is observed even if the document does not claim PDF/A-1 conformance.
|
static |
Save flag: Remove unused objects (PDF).
This flag is ignored, unused objects are always removed.
|
static |
Flag for setField(), addField(), and applyFdf(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run.
This flag overrides for creating the appearance stream SignDocField.j_left and SignDocField.j_right set by SignDocField.setJustification(). This flag is ignored for SignDocField.j_center.
|
static |
Flag for setField(), addField(), and applyFdf(): Choose direction automatically, default to LTR.
The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.
The paragraph level will be 0 (LTR) for paragraphs having no strong directional character.
If none of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl is set, sff_ltr will be used.
At most one of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl can be set.
Usage of sff_default_ltr is not recommended as the visual representation of the value of the field may not match the value of the field (as interpreted by software which does not know that the paragraph direction is supposed to be default-LTR). Use sff_default_ltr only as last resort if you cannot modify the text received from a default-LTR input field appropriately for paragraph direction LTR used in PDF fields.
|
static |
Flag for setField(), addField(), and applyFdf(): Choose direction automatically, default to RTL.
The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.
The paragraph level will be 1 (RTL) for paragraphs having no strong directional character.
If none of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl is set, sff_ltr will be used.
At most one of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl can be set.
Usage of sff_default_rtl is not recommended as the visual representation of the value of the field may not match the value of the field (as interpreted by software which does not know that the paragraph direction is supposed to be default-RTL). Use sff_default_rtl only as last resort if you cannot modify the text received from a default-RTL input field appropriately for paragraph direction LTR used in PDF fields.
|
static |
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.
|
static |
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.
|
static |
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.
This flag is provided for compatibility with existing code; setField(), addField(), and applyFdf() now always assume this flag is set.
|
static |
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.
|
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.
|
static |
Flag for setField(), addField(), and applyFdf(): Paragraph direction: LTR.
If none of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl is set, sff_ltr will be used.
At most one of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl can be set.
|
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.
In documents using Tagged PDF, widgets can be moved only within the page, they cannot be moved to a different page.
|
static |
Flag for setField(), addField(), and applyFdf(): Paragraph direction: RTL.
If none of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl is set, sff_ltr will be used.
At most one of sff_ltr, sff_rtl, sff_default_ltr, and sff_default_rtl can be set.
Usage of sff_rtl is not recommended as the visual representation of the value of the field may not match the value of the field (as interpreted by software which does not know that the paragraph direction is supposed to be RTL). Use sff_rtl only as last resort if you cannot modify the text received from an RTL input field appropriately for paragraph direction LTR used in PDF fields.
|
static |
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.
|
static |
Flag for setShootInFoot(): Allow elliptic curves for signing which are not supported by Adobe products for Windows.
As of August 2016, Adobe Acrobat XI and 2015 for Windows support these curves: secp192r1 (prime192v1), secp256r1 (prime256v1), secp224r1, secp384r1, and secp521r1.
Setting this flag enables additional curves: prime192v2, prime192v3, prime239v1, prime239v2, prime239v3, secp112r1, secp112r2, secp160r1, secp160k1, secp256k1, secp128r1, secp128r2, secp160r2, secp192k1, secp224k1, brainpoolp160r1, brainpoolp192r1, brainpoolp224r1, brainpoolp256r1, brainpoolp320r1, brainpoolp384r1, and brainpoolp512r1. However, most of these are not supported (for signing and verifying) by SignDoc SDK for iOS, OS X, and Windows Store apps due to limitations of those operating systems.
This flag is ignored (and assumed to be set) for TIFF documents. This flag is ignored if SignDocSignatureParameters.setPKCS7() is used.
|
static |
Flag for setShootInFoot(): Allow operations to break signatures which grant permissions.
This flag is available for PDF documents only.
|
static |
Flag for setShootInFoot(): Allow operations to break existing signatures in signature fields.
This flag is available for PDF documents only.
|
static |
Flag for setShootInFoot(): Allow operations to break Tagged PDF (and PDF/UA).
If this flag is not set, operations that would break Tagged PDF will report an error.
If this flag is set, all operations may break Tagged PDF without reporting an error. The target document's logical structure may be broken or incomplete (and thus violating PDF/UA) after such an operation.
This flag is available for PDF documents only.
|
static |
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 |
Flag for setShootInFoot(): Allow non-standard usage of external (non-embedded) TrueType and CFF fonts.
If this flag is not set, TrueType and CFF fonts must be embedded; when trying to use a TrueType or CFF font that is not embededded, SignDocFontNotFoundException will be thrown.
If this flag is set, external TrueType and CFF 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.
|
static |
Flag for setShootInFoot(): 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.
|
static |
Flag for setShootInFoot(): 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.
|
static |
Flag for setShootInFoot(): Disable verification of signature after signing by addSignature().
You might want to set this flag if you always perform a complete verification with verifySignature() after calling addSignature().
|
static |
Flag for updateDSS() and updateDSS2(): Perform all the checks but do not modify the document.
|
static |
Flag for updateDSS() and updateDSS2(): Create VRI dictionaries.
This is discouraged by ETSI TS 103 172 V2.2.2 section 8.1.1.
|
static |
Vertical alignment for addTextRect(): Align bottom.
|
static |
Vertical alignment for addTextRect(): Center.
|
static |
Vertical alignment for addTextRect(): Align top.