PDF2HTML5

The PDF2HTML5 function is used to export a PDF document to HTML5 format. This function is only available with the DHTML Converter product and requires a call to SetLicenseKey before it can be used.

 

This method needs special license.  Please, contact our Sales Department for more information

 

Syntax

DLL:

long PDF2HTML5(LPCSTR InputFile, LPCSTR  Password, LPCSTR OutputFile, long Options, long OptimizeLevel)

 

Parameters

InputFile

Full path of PDF file to convert to HTML.

Password

Password, if any, needed to open the PDF file.

OutputFile

Full path of resulting HTML file.

Options

HTML generation options.

 

Optimization Level

Value

Description

No optimization

0

Recommended when exporting to JPEG and Tiff formats.

Line optimization

1

Recommended when exporting to RTF format.

Paragraph optimization

2

Recommended when exporting to HTML format.

Table optimization

3

Recommended when exporting to Excel format.

 

OptimizeLevel

Optimization level to apply to PDF document before exporting to HTML5.

 

Permission

Value

No optimization

0

Line optimization

1

Paragraph optimization (Recommended)

2

Table optimization

3

 

Return Value

The return value is True if the document was converted, False otherwise.

 

Remarks

This function is only available if the activation code is for the DHTML Converter product, or a DHTML Converter product combined with other Document Converter products.

 

Example

// PDF Converter Cpp.cpp : Defines the entry point for the console application.

// 

 

#include <Windows.h>

#include <string>

#include <iostream>

#include "CdIntf.h"

#pragma comment (lib, "CDIntf.lib")

 

using namespace std;

 

enum OPTIMIZE 

{

    NO_OPTIMIZATION = 0,

    LINE_OPTIMIZATION = 1,

    PARAGRAPH_OPTIMIZATION = 2,

    TABLE_OPTIMIZATION = 3

};

 

int main()

{

     // Constants for Activation codes

    #define strLicenseTo  "Amyuni PDF Converter Evaluation"

    #define strActivationCode "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

 

    // The SetLicenseKey method should be called after creating an object of type 

    // CDIntfEx.Document to activate the advanced methods that require the object 

    // activation code to work properly

    SetLicenseKeyA(strLicenseTo, strActivationCode);

 

    // Convert PDF to HTML5 document

    LPCSTR passWord = NULL;

    PDF2HTML5( "c:\\temp\\test.pdf", passWord, "c:\\temp\\test.html", HTML5OPTION_DEFAULT, OPTIMIZE::PARAGRAPH_OPTIMIZATION);

 

    return 0;

}