65.9K
CodeProject is changing. Read more.
Home

A simple wrapper to control Acrobat Reader from your application

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.96/5 (11 votes)

Nov 9, 2004

viewsIcon

188907

downloadIcon

2379

This class wraps some useful DDE messages to control Acrobat from your application

Introduction

Acrobat Reader can't be driven using Automation. Only few restrictive DDE messages has been defined by adobe to control reader from outside.

This class maps some usefull DDE messages that will allow you open, seek, print and close a file in acrobat.

Background

The DDE message description can be downloaded from the Adobe web site (IACReference.pdf)

Using the code

Using the class is simple :

//Sure, you need at least to include that file !
#include "ReaderWrapper.h"

    // This will instanciate a new object
    CReaderWrapper ReaderDemo("d:\\test.pdf");
    
    // Open your document inside acrobat
    ReaderDemo.DocOpen();

    //Seek display to page 4
    ReaderDemo.GoToPage(4);

    //Print the file without displaying any modal dialog box
    ReaderDemo.FilePrintSilent();

    //Close the document
    ReaderDemo.DocClose();

    //Exit reader
    ReaderDemo.ExitAcrobat();
//

History

  • 1.1 (2004/11/09) First release.