Class SignatureLine

    • Field Detail

      • QNAME_SIGNATURE_LINE

        protected static final QName QNAME_SIGNATURE_LINE
    • Constructor Detail

      • SignatureLine

        public SignatureLine()
    • Method Detail

      • getSetupId

        public ClassID getSetupId()
      • setSetupId

        public void setSetupId​(ClassID setupId)
      • getAllowComments

        public Boolean getAllowComments()
      • setAllowComments

        public void setAllowComments​(Boolean allowComments)
      • getSigningInstructions

        public String getSigningInstructions()
      • setSigningInstructions

        public void setSigningInstructions​(String signingInstructions)
      • getSuggestedSigner

        public String getSuggestedSigner()
      • setSuggestedSigner

        public void setSuggestedSigner​(String suggestedSigner)
      • getSuggestedSigner2

        public String getSuggestedSigner2()
      • setSuggestedSigner2

        public void setSuggestedSigner2​(String suggestedSigner2)
      • getSuggestedSignerEmail

        public String getSuggestedSignerEmail()
      • setSuggestedSignerEmail

        public void setSuggestedSignerEmail​(String suggestedSignerEmail)
      • getDefaultCaption

        public String getDefaultCaption()
        The default caption
        Returns:
        "[suggestedSigner] \n [suggestedSigner2] \n [suggestedSignerEmail]"
      • getCaption

        public String getCaption()
      • setCaption

        public void setCaption​(String caption)
        Set the caption - use maximum of three lines separated by "\n". Defaults to getDefaultCaption()
        Parameters:
        caption - the signature caption
      • getInvalidStamp

        public String getInvalidStamp()
      • setInvalidStamp

        public void setInvalidStamp​(String invalidStamp)
        Sets the text stamped over the signature image when the document got tampered with
        Parameters:
        invalidStamp - the invalid stamp text
      • getPlainSignature

        public byte[] getPlainSignature()
        the plain signature without caption
      • setPlainSignature

        public void setPlainSignature​(byte[] plainSignature)
        Sets the plain signature supported formats are PNG,GIF,JPEG,(SVG),EMF,WMF. for SVG,EMF,WMF poi-scratchpad needs to be in the class-/modulepath
        Parameters:
        plainSignature - the plain signature - if null, the signature is not rendered and only the caption is visible
      • getContentType

        public String getContentType()
      • setContentType

        public void setContentType​(String contentType)
      • getSignatureShape

        public com.microsoft.schemas.vml.CTShape getSignatureShape()
      • setSignatureShape

        public void setSignatureShape​(com.microsoft.schemas.vml.CTShape signatureShape)
      • setSignatureShape

        public void setSignatureShape​(com.microsoft.schemas.office.office.CTSignatureLine signatureLine)
      • parse

        protected void parse()
      • setRelationId

        protected abstract void setRelationId​(com.microsoft.schemas.vml.CTImageData imageData,
                                              String relId)
      • update

        protected void update()
      • plainPng

        protected byte[] plainPng()
                           throws IOException
        Word and Excel a regenerating the valid and invalid signature line based on the plain signature. Both are picky about the input format. Especially EMF images need to a specific device dimension (dpi) instead of fiddling around with the input image, we generate/register a bitmap image instead
        Returns:
        the converted PNG image
        Throws:
        IOException
      • generateImage

        protected byte[] generateImage​(boolean showSignature,
                                       boolean showInvalidStamp)
                                throws IOException
        Generate the image for a signature line
        Parameters:
        showSignature - show signature image - use false for placeholder images in to-be-signed documents
        showInvalidStamp - print invalid stamp over the signature
        Returns:
        the signature image in PNG format as byte array
        Throws:
        IOException