ceTe Software Help Library for Java August - 2020
DynamicPDF Generator for Java / Installation Guide / Adding License
In This Topic
    Adding License
    In This Topic

    How to get a License

    Please go to www.dynamicpdf.com to purchase a license for DynamicPDF for Java. You will receive a serial Number and instructions on how to obtain a license Key.

    Adding a Developer License

    A Developer license key has to be added from your code. To add a license call the com.cete.dynamicpdf.Document.addLicense("Key") method. This is a static method;therefore it can be called from any place,at any time. This needs to be done in only one place in your source code.

    Please make sure you have added the license key before starting to use DynamicPDF Generator. In cases where an invalid license has been used or you have not added the license key before the document.draw() method is called, a DynamicPDF logo will be drawn as a watermark on the PDF.

    Adding a Server License

    A Server license can be added from your code or from an entry in the web.xml file (web application).
    From your code
    To add a license,call the com.cete.dynamicpdf.Document.addLicense("Key") method. This is a static method;therefore it can be called from any place,at any time. This needs to be done in only one place in your source code.

    Please make sure you have added the license key before starting to use DynamicPDF Generator. In cases where an invalid license has been used or you have not added the license key before the document.draw() method is called, a DynamicPDF logo will be drawn as a watermark on the PDF.

    From an entry in the web.xml file
    To add the license key using this option, you will have to add the license key to the web.xml file of your web application and then use the DynamicLicenseServlet.class (or compile the same DynamicLicenseServlet.java) that we have provided under the /ceTeSoftware/licensing/ directory.
    This servlet gets the license key value from the web.xml file and takes care of adding the license.

    You will need entries in the web.xml to do the servlet entry, servlet mapping and adding of the license keys.

    Here are the entries you need for the servlet entry and adding of the license key(s):

                        <servlet>
                            <servlet-name>DynamicLicenseServlet</servlet-name>
                            <servlet-class>DynamicLicenseServlet</servlet-class>
                                <init-param>
                                    <param-name>LicenseKey1</param-name>
                                    <param-value>YourKey1</param-value>
                                </init-param>
                                <init-param>
                                    <param-name>LicenseKey2</param-name>
                                    <param-value>YourKey2</param-value>
                                </init-param>
                                <init-param>
                                    <param-name>LicenseKey---N</param-name>
                                     <param-value>YourKey---N</param-value>
                                </init-param>
                                <load-on-startup>1</load-on-startup>
                        </servlet>

    For the <servlet-class>, please provide the servlet path where you have placed DynamicLicenseServlet. The <load-on-startup> is a very important node in this case, please make sure that you don't delete it by accident.

    You can add multiple keys if you have multiple server licenses and want to use the same web.xml file on all machines; this may be typical in a load-balanced environment. That is why we have shown multiple <init-param> nodes - one for each license key. Please add or remove these nodes as required.

    Here are the entries you will need for the servlet mapping:

             <servlet-mapping>
                    <servlet-name>DynamicLicenseServlet</servlet-name>
                    <url-pattern>/DynamicLicenseServlet</url-pattern>
             </servlet-mapping>