PDF2HTML

The PDF2HTML function converts a PDF document to an HTML document. 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 PDF2HTML(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.

 

Options

Description

Value

HTMLOPTION_LAYERS

Multiple pages in a single HTML file using layers.

0x0001

HTMLOPTION_SINGLE_PAGE

All pages in a single HTML file.

0x0001

HTMLOPTION_MULTIPLE_PAGES

Each page in a separate HTML file.

0x0002

 

OptimizeLevel

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

 

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.

 

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 HTML document

    LPCSTR passWord = NULL;

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

 

    return 0;

}