LinearizePDFDocument

The LinearizePDFDocument function can be used to optimize a document for web viewing. PDF documents usually need to be completely downloaded before they can be viewed. A linearized document can be viewed one page at a time without the need to completely download the document. This function requires a call to Document.SetLicenseKey before it can be used.

 

Syntax

DLL:

BOOL LinearizePDFDocument(LPCSTR FileName)

 

Parameters

FileName

Full path of PDF file to optimize.

 

Return Value

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

 

Remarks

This function is only available if the activation code is for a professional version of the Amyuni PDF Converter. In the case of the evaluation version, a message-box appears to indicate that the document is being optimized.

 

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 PERMISSIONS 

{

    NO_PERMISSION = 0xFFFFFFC0,

    ENABLE_PRINTING = 0xFFFFFFC0 + 4,

    ENABLE_DOCUMENT_MODIFICATION = 0xFFFFFFC0 + 8,

    ENABLE_COPYING_TEXT_GRAPHICS = 0xFFFFFFC0 + 16,

    ENABLE_ADDING_CHANGING_NOTES = 0xFFFFFFC0 + 32

};

 

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);

 

    // Linearize Document

    LinearizepdfDocument( "c:\\temp\\test.pdf");

 

    return 0;

}