Skip to content
Guides

Apply the License

You need to initialize the ComPDFKit Conversion SDK with a license before calling any API. You can contact ComPDFKit team to get a trial license.

java
    private static final String license_file = "";
    private static final String AI_license = "";
    private static final CPDFConvert cpdfConvertWord;
    private static final CPDFConvert cpdfConvertExcel;
    private static final CPDFConvert cpdfConvertExcelNew;
    private static final CPDFConvert cpdfConvertPpt;
    private static final CPDFConvert cpdfConvertTxt;
    private static final CPDFConvert cpdfConvertImg;
    private static final CPDFConvert cpdfConvertRTF;
    private static final CPDFConvert cpdfConvertHTML;
    private static final CPDFConvert cpdfConvertCSV;
    private static final DocumentAIOCRFunction documentAIOCRFunction ;
    private static final DocumentAILayoutFunction documentAILayoutFunction ;
    private static final DocumentAITableRecFunction documentAITableRecFunction;
    private static final PdfToOfficeNative.CPDFConverter.PSO_StartOCR psoStartOCR;

    private static final String input_file = "/input_files/";
    private static final String output_file = "/output_files";
    private static final String password = "";

    static {
        CPDFConvertLicense.getInstance(license_file, (byte) 0, "", "", (byte) 0);
        DocumentAILicense.getInstance(AI_license);
        psoStartOCR = ConversionTest::ocrResultHandle;
        CPDFConvert.setOcrCallback(psoStartOCR);
        cpdfConvertWord = new CPDFConvertWord();
        cpdfConvertExcel = new CPDFConvertExcel();
        cpdfConvertExcelNew = new CPDFConvertExcelNew();
        cpdfConvertPpt = new CPDFConvertPpt();
        cpdfConvertTxt = new CPDFConvertTxt();
        cpdfConvertImg = new CPDFConvertImg();
        cpdfConvertRTF = new CPDFConvertRTF();
        cpdfConvertHTML = new CPDFConvertHTML();
        cpdfConvertCSV = new CPDFConvertCSV();
        documentAIOCRFunction = new DocumentAIOCRFunction();
        documentAILayoutFunction = new DocumentAILayoutFunction();
        documentAITableRecFunction = new DocumentAITableRecFunction();
    }