Class PDFOptions


  • public class PDFOptions
    extends java.lang.Object
    Class for all the optional PDF output options. Only for
    • Constructor Summary

      Constructors 
      Constructor Description
      PDFOptions()
      Constructor for the PDFOptions object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer getCopies()  
      java.lang.Boolean getEvenPage()  
      java.lang.Boolean getIdentifyFormFields()  
      com.google.gson.JsonObject getJSON()  
      java.lang.Boolean getLandscape()
      Only supported when converting HTML to PDF.
      java.lang.Boolean getLockForm()  
      java.lang.Boolean getMerge()  
      java.lang.Boolean getMergeMakingEven()  
      java.lang.String getModifyPassword()  
      java.lang.String getPageFormat()
      Only supported when converting HTML to PDF.
      java.lang.String getPageHeight()
      Only supported when converting HTML to PDF.
      int[] getPageMargin()
      Only supported when converting HTML to PDF.
      java.lang.String getPageWidth()
      Only supported when converting HTML to PDF.
      java.lang.Integer getPasswordProtectionFlag()
      More info on the flag bits on https://pdfhummus.com/post/147451287581/hummus-1058-and-pdf-writer-updates-encryption.
      java.lang.String getReadPassword()  
      java.lang.String getSignCertificate()
      It is possible to sign the output PDF if the output pdf has a signature field.
      java.lang.Boolean getSplit()  
      java.lang.String getWatermark()  
      void setCopies​(java.lang.Integer copies)  
      void setEvenPage​(java.lang.Boolean evenPage)  
      void setIdentifyFormFields​(java.lang.Boolean identifyFormFields)  
      void setLandscape​(java.lang.Boolean landscape)
      Only supported when converting HTML to PDF.
      void setLockForm​(java.lang.Boolean lockForm)  
      void setMerge​(java.lang.Boolean merge)  
      void setMergeMakingEven​(java.lang.Boolean mergeMakingEven)  
      void setModifyPassword​(java.lang.String modifyPassword)  
      void setPageFormat​(java.lang.String pageFormat)
      Only supported when converting HTML to PDF.
      void setPageHeight​(java.lang.String pageHeight)
      Only supported when converting HTML to PDF.
      void setPageMargin​(int pageMargin)
      Only supported when converting HTML to PDF.
      void setPageMargin​(int[] pageMargins)
      Only supported when converting HTML to PDF.
      void setPageWidth​(java.lang.String pageWidth)
      Only supported when converting HTML to PDF.
      void setPasswordProtectionFlag​(java.lang.Integer passwordProtectionFlag)
      More info on the flag bits on https://pdfhummus.com/post/147451287581/hummus-1058-and-pdf-writer-updates-encryption.
      void setReadPassword​(java.lang.String readPassword)  
      void setSignCertificate​(java.lang.String signCertificate)
      It is possible to sign the output PDF if the output pdf has a signature field.
      void setSplit​(java.lang.Boolean split)  
      void setWatermark​(java.lang.String watermark)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PDFOptions

        public PDFOptions()
        Constructor for the PDFOptions object. Set the options with the setters. Uninitialized options won't be included in the JSON.
    • Method Detail

      • getReadPassword

        public java.lang.String getReadPassword()
        Returns:
        password to read the output.
      • setReadPassword

        public void setReadPassword​(java.lang.String readPassword)
        Parameters:
        readPassword - password to read the output.
      • getWatermark

        public java.lang.String getWatermark()
        Returns:
        diagonal custom watermark on every page in the output file.
      • setWatermark

        public void setWatermark​(java.lang.String watermark)
        Parameters:
        watermark - diagonal custom watermark on every page in the output file.
      • getPageWidth

        public java.lang.String getPageWidth()
        Only supported when converting HTML to PDF.
        Returns:
        pageWidth width followed by unit : px, mm, cm, in (e.g. : 20 px). No unit means px.
      • setPageWidth

        public void setPageWidth​(java.lang.String pageWidth)
        Only supported when converting HTML to PDF.
        Parameters:
        pageWidth - width followed by unit : px, mm, cm, in (e.g. : 20 px). No unit means px.
      • getPageHeight

        public java.lang.String getPageHeight()
        Only supported when converting HTML to PDF.
        Returns:
        pageHeight height followed by unit : px, mm, cm, in (e.g. : 20 px). No unit means px.
      • setPageHeight

        public void setPageHeight​(java.lang.String pageHeight)
        Only supported when converting HTML to PDF.
        Parameters:
        pageHeight - eight followed by unit : px, mm, cm, in (e.g. : 20 px). No unit means px.
      • getEvenPage

        public java.lang.Boolean getEvenPage()
        Returns:
        true if output will have even pages (blank page added if uneven amount of pages).
      • setEvenPage

        public void setEvenPage​(java.lang.Boolean evenPage)
        Parameters:
        evenPage - Whether output has even pages (blank page added if uneven amount of pages).
      • getMergeMakingEven

        public java.lang.Boolean getMergeMakingEven()
        Returns:
        If Cloud Office Print is going to merge all the append/prepend and template files, making sure the output is even-paged (adding a blank page if the output is uneven-paged).
      • setMergeMakingEven

        public void setMergeMakingEven​(java.lang.Boolean mergeMakingEven)
        Parameters:
        mergeMakingEven - Whether you want to merge all the append/prepend and template files, making sure the output is even-paged (adding a blank page if the output is uneven-paged).
      • getModifyPassword

        public java.lang.String getModifyPassword()
        Returns:
        The password needed to modify the PDF.
      • setModifyPassword

        public void setModifyPassword​(java.lang.String modifyPassword)
        Parameters:
        modifyPassword - Password needed to modify the PDF.
      • getPasswordProtectionFlag

        public java.lang.Integer getPasswordProtectionFlag()
        More info on the flag bits on https://pdfhummus.com/post/147451287581/hummus-1058-and-pdf-writer-updates-encryption.
        Returns:
        protection flag for the PDF (in addition to the user password). (int representation of the 12 flag bits)
      • setPasswordProtectionFlag

        public void setPasswordProtectionFlag​(java.lang.Integer passwordProtectionFlag)
        More info on the flag bits on https://pdfhummus.com/post/147451287581/hummus-1058-and-pdf-writer-updates-encryption.
        Parameters:
        passwordProtectionFlag - protection flag for the PDF (in addition to the user password). (int representation of the 12 flag bits)
      • getLockForm

        public java.lang.Boolean getLockForm()
        Returns:
        If the output PDF will be locked/flattened.
      • setLockForm

        public void setLockForm​(java.lang.Boolean lockForm)
        Parameters:
        lockForm - Set to true if you want the output PDF to be locked/flattened.
      • getCopies

        public java.lang.Integer getCopies()
        Returns:
        Number of times the output will be repeated.
      • setCopies

        public void setCopies​(java.lang.Integer copies)
        Parameters:
        copies - Amount of times the output will be repeated.
      • getPageMargin

        public int[] getPageMargin()
        Only supported when converting HTML to PDF.
        Returns:
        top bottom left right margin in pixels .
      • setPageMargin

        public void setPageMargin​(int[] pageMargins)
                           throws java.lang.Exception
        Only supported when converting HTML to PDF.
        Parameters:
        pageMargins - top bottom left right margin in pixels .
        Throws:
        java.lang.Exception - If not exact 4 margins are given.
      • setPageMargin

        public void setPageMargin​(int pageMargin)
        Only supported when converting HTML to PDF.
        Parameters:
        pageMargin - Margin (same for all sides).
      • getLandscape

        public java.lang.Boolean getLandscape()
        Only supported when converting HTML to PDF.
        Returns:
        True if orientation is landscape, false if orientation is portrait (default used by server).
      • setLandscape

        public void setLandscape​(java.lang.Boolean landscape)
        Only supported when converting HTML to PDF.
        Parameters:
        landscape - Set to true if you want the orientation of the output to be landscape, false for portrait (default used by server).
      • getPageFormat

        public java.lang.String getPageFormat()
        Only supported when converting HTML to PDF.
        Returns:
        The page format: "A4" (default used by Cloud Office Print) or "letter".
      • setPageFormat

        public void setPageFormat​(java.lang.String pageFormat)
        Only supported when converting HTML to PDF.
        Parameters:
        pageFormat - The page format: "A4" or "letter".
      • getMerge

        public java.lang.Boolean getMerge()
        Returns:
        True if instead of returning back a zip file for multiple outputs, they will be merged in one output.
      • setMerge

        public void setMerge​(java.lang.Boolean merge)
        Parameters:
        merge - Set to true if you want to instead of returning back a zip file for multiple outputs, they will be merged in one output.
      • getSignCertificate

        public java.lang.String getSignCertificate()
        It is possible to sign the output PDF if the output pdf has a signature field.
        Returns:
        The certificate (pkcs #12 .p12/.pfx) in a base64 encoded format (this can also be a URL, FTP location or a location in the file system of the server).
      • setSignCertificate

        public void setSignCertificate​(java.lang.String signCertificate)
        It is possible to sign the output PDF if the output pdf has a signature field.
        Parameters:
        signCertificate - The certificate (pkcs #12 .p12/.pfx) in a base64 encoded format (this can also be a URL, FTP location or a location in the file system of the server).
      • getIdentifyFormFields

        public java.lang.Boolean getIdentifyFormFields()
        Returns:
        If it is set to true Cloud Office Print tries to identify the form fields and fills them in.
      • setIdentifyFormFields

        public void setIdentifyFormFields​(java.lang.Boolean identifyFormFields)
        Parameters:
        identifyFormFields - If it is set to true Cloud Office Print tries to identify the form fields and fills them in.
      • getSplit

        public java.lang.Boolean getSplit()
        Returns:
        whether or not the output PDF should be split into one file per page in a zip file
      • setSplit

        public void setSplit​(java.lang.Boolean split)
        Parameters:
        split - whether or not the output PDF should be split into one file per page in a zip file
      • getJSON

        public com.google.gson.JsonObject getJSON()
        Returns:
        JSON-representation of this object