PDF2XPS

The ExportToXPS method will export the printed file into the new Microsoft XPS document format. This function is only available with the XPS 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 PDF2XPS(LPCSTR InputFile, LPCSTR Password, LPCSTR OutputFile, long Options, long OptimizeLevel)

 

Parameters

InputFile

Full path of PDF file to convert to XPS.

Password

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

OutputFile

Full path of resulting XPS file.

Options

XPS generation options. Reserved for future use.

OptimizeLevel

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

 

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 XPS Converter product, or an XPS 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 XPS file

    LPCSTR passWord = NULL;

    PDF2XPS( "c:\\temp\\test.pdf", passWord, "c:\\temp\\test.xps", 0, OPTIMIZE::PARAGRAPH_OPTIMIZATION  );

 

    return 0;

}