Click here to Skip to main content
15,887,267 members
Articles / Programming Languages / C++
Article

A simple wrapper to control Acrobat Reader from your application

Rate me:
Please Sign up or sign in to vote.
3.96/5 (12 votes)
9 Nov 2004 185.3K   2.4K   40   42
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</CODE>("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


Written By
Instructor/Trainer
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Printing problem, is it caused by version 7 ? Pin
PC-Alex14-May-05 23:38
PC-Alex14-May-05 23:38 
GeneralVB.Net HowTo Pin
steel123425-Mar-05 4:38
steel123425-Mar-05 4:38 
GeneralRe: VB.Net HowTo Pin
yltsa30-Apr-05 4:31
yltsa30-Apr-05 4:31 
Generalhelp Pin
robig22-Mar-05 0:23
robig22-Mar-05 0:23 
GeneralRe: help Pin
bjw04-Aug-05 7:01
bjw04-Aug-05 7:01 
GeneralRe: help Pin
bjw04-Aug-05 7:13
bjw04-Aug-05 7:13 
GeneralPick the printer Pin
CanopenR25-Feb-05 13:21
CanopenR25-Feb-05 13:21 
GeneralTwo Verison of Adobe Pin
CanopenR25-Feb-05 12:49
CanopenR25-Feb-05 12:49 
Got a problem with your wraper, I have Adobe 6.0 pro & Adobe reader 7.0 installed on my system. Each time i run my app it starts pro and does not work correctly. But if i open reader and run my app it works in reader just fine..

How do i tell my app to run reader only??
GeneralRe: Two Verison of Adobe Pin
iver10-May-05 22:12
iver10-May-05 22:12 
GeneralNon-MFC Version Pin
Enrico Pangan16-Feb-05 15:30
Enrico Pangan16-Feb-05 15:30 
GeneralcReaderWrapper class Pin
holzert10-Dec-04 4:47
holzert10-Dec-04 4:47 
GeneralCompiling error Pin
Piccinano10-Nov-04 4:11
Piccinano10-Nov-04 4:11 
GeneralRe: Compiling error Pin
seasidetech10-Nov-04 4:18
seasidetech10-Nov-04 4:18 
GeneralRe: Compiling error Pin
Piccinano10-Nov-04 4:32
Piccinano10-Nov-04 4:32 
GeneralRe: Compiling error Pin
seasidetech10-Nov-04 4:34
seasidetech10-Nov-04 4:34 
GeneralRe: Compiling error Pin
Piccinano10-Nov-04 4:43
Piccinano10-Nov-04 4:43 
GeneralRe: Compiling error Pin
seasidetech10-Nov-04 4:51
seasidetech10-Nov-04 4:51 
GeneralRe: Compiling error Pin
msabhilash12312-Mar-09 19:38
msabhilash12312-Mar-09 19:38 
GeneralDemo App Pin
seasidetech9-Nov-04 22:31
seasidetech9-Nov-04 22:31 
Generaldefinitely a worthy subject Pin
.dan.g.9-Nov-04 12:08
professional.dan.g.9-Nov-04 12:08 
GeneralRe: definitely a worthy subject Pin
tom_dx9-Nov-04 15:10
tom_dx9-Nov-04 15:10 
GeneralRe: definitely a worthy subject Pin
22-Nov-04 8:04
suss22-Nov-04 8:04 
GeneralRe: definitely a worthy subject Pin
seasidetech23-Nov-04 1:56
seasidetech23-Nov-04 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.