PDF2RTF

The PDF2RTF function converts a PDF document to an RTF document. This function is only available with the RTF 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 PDF2RTF(LPCSTR InputFile, LPCSTR  Password, LPCSTR OutputFile, long Options, long OptimizeLevel)

 

Parameters

InputFile

Full path of PDF file to convert to RTF.

Password

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

OutputFile

Full path of resulting RTF file.

Options

RTF generation options.

 

DLL Constants

Value

Description

RTFOPTION_ADVANCED

0x0000

Using frames to position objects

RTFOPTION_FULL

0x0001

Text, Graphics, and images with no frames

RTFOPTION_RTFTEXT

0x0002

Formatted text only

RTFOPTION_TEXT

0x0003

Simple Text

RTFOPTION_NOTABS

0x10000

 

OptimizeLevel

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

 

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 RTF Converter product, or an RTF 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 RTF document

    LPCSTR passWord = NULL;

    PDF2RTF( "c:\\temp\\test.pdf", passWord, "c:\\temp\\test.rtf", RTFOPTION_FULL, OPTIMIZE::PARAGRAPH_OPTIMIZATION);

 

    return 0;

}