English | 日本
BCL Technologies
Shopping CartContact Us
   Create-PDF API    PDF-to-Word API    PDF-to-HTML API    PDF-Conversion API for LINUX
 

Sample Code

Please refer to the Getting Started manual on how to compile these following sample codes.

PDF-to-Word API

PDF-to-HTML API

PDF-to-Word API Sample Code

/* ------------------------------------------------*/
#include 
#include "../include/EasyConverter.h"

static const char* BclLicenseKey = "xxxx-xxxx-xxxx-xxxx-xxxx-xxxx"; // <-- YOUR LICENSE KEY COMES HERE

static BclConversionResponseOption ConverterPageStart(void* UserData, int PageNumber, int PageCount, const char* FileName)
{
    printf("Page %d of %d\n", PageNumber, PageCount);
    return BCL_CNV_CONTINUE;
}

int main (int argc, const char * argv[])
{
    printf("PDF2Word command-line (%d-bit). (C) 2014 BCL Technologies\n\n", (int)(sizeof(void*) * 8));
    if(argc != 3)
    {
        printf("Syntax: PDF2WordBasic input.pdf output.rtf\n");
        return 0;
    }

    BclPDF2WordSettings settings;
    BclInitPDF2WordSettings(&settings); // Initialize with default settings
    settings.OnPageStart = ConverterPageStart; // Callback function
    //settings.FileConversionTimeout = 10 * BCL_MINUTES;
    BclConversionResult result = BclConvertToWord(
                     argv[1],           // input filename
                     argv[2],           // output filename
                     BCL_NO_PASSWORD,   // password
                     BCL_CNV_ALL_PAGES, // from page
                     BCL_CNV_ALL_PAGES, // to page
                     BclLicenseKey,
                     &settings);
    printf("\nConversion result: %d: %s\n", result, BclConversionResultToText(result));
    return 0;
}

PDF-to-HTML API Sample Code

/* ---------------------------------------------------*/
#include 
#include "../include/EasyConverterHTML.h"

static const char* BclLicenseKey = "xxxx-xxxx-xxxx-xxxx-xxxx-xxxx"; // <-- YOUR LICENSE KEY COMES HERE

static BclHtmlConversionResponseOption ConverterPageStart(void* UserData, int PageNumber, int PageCount, const char* FileName)
{
    printf("Page %d of %d\n", PageNumber, PageCount);
    return BCL_H_CNV_CONTINUE;
}

int main (int argc, const char * argv[])
{
    printf("PDF2HTML command-line (%d-bit). (C) 2014 BCL Technologies\n\n", (int)(sizeof(void*) * 8));
    if(argc != 4)
    {
        printf("Syntax: PDF2HTMLBasic input.pdf output.html\n");
        return 0;
    }
    
    BclPDF2HTMLSettings settings;
    BclInitPDF2HTMLSettings(&settings); // Initialize with default settings
    settings.OnPageStart = ConverterPageStart; // Callback function
    //settings.FileConversionTimeout = 10 * BCL_MINUTES;
    BclHtmlConversionResult result = BclConvertToHTML(
                     argv[1],           // input filename
                     argv[2],           // output filename
                     BCL_H_NO_PASSWORD,   // password
                     BCL_H_CNV_ALL_PAGES, // from page
                     BCL_H_CNV_ALL_PAGES, // to page
                     BclLicenseKey,
                     &settings);
    printf("\nConversion result: %d: %s\n", result, BclAbsolutePositionHtmlConversionResultToText(result));
    return 0;
}
  

 

 

 
-
 
BCL
© 1993 - , BCL Technologies.
All other trademarks are the property of their respective owners.