The PDF2EXCEL function converts a PDF document to a Microsoft® Excel® document. This function is only available with the Excel 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
long PDF2EXCEL(LPCSTR InputFile, LPCSTR Password, LPCSTR OutputFile, long Options, long OptimizeLevel)
InputFile
Full path of PDF file to convert to Excel.
Password
Password, if any, needed to open the PDF file.
OutputFile
Full path of resulting Excel file.
Options
Excel generation options.
DLL Constants |
Value |
Description |
---|---|---|
EXCELOPTION_SINGLE_SHEET |
0 |
All pages in one sheet. |
EXCELOPTION_MULTIPLE_SHEETS |
1 |
One sheet per page. |
OptimizeLevel
Optimization level to apply to PDF document before exporting to EXCEL.
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. |
The return value is True if the document was converted, False otherwise.
This function is only available if the activation code is for the Excel Converter product, or an Excel Converter product combined with other Document Converter products.
// 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 EXCEL file
LPCSTR passWord = NULL;
PDF2EXCEL( "c:\\temp\\test.pdf", passWord, "c:\\temp\\test.xls", EXCELOPTION_MULTIPLE_SHEETS, OPTIMIZE::TABLE_OPTIMIZATION);
return 0;
}