Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A simple wrapper to control Acrobat Reader from your application

0.00/5 (No votes)
9 Nov 2004 1  
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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here