Click here to Skip to main content
15,885,164 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

 
GeneralIs there any way to search and locate inside acrobat reader control Pin
Member 48506929-May-10 0:37
Member 48506929-May-10 0:37 
Is there any way to search and locate inside acrobat reader control

john
GeneralFailed to build this code with VS 2003 C++ Pin
Monkeyhorse12-Jan-10 7:08
Monkeyhorse12-Jan-10 7:08 
QuestionHow to do the same in C# Pin
PooranPrasad4-Oct-09 20:18
PooranPrasad4-Oct-09 20:18 
GeneralFilePrintSilent - Synchronous/Serialize Pin
topperpbb22-May-06 3:27
topperpbb22-May-06 3:27 
Generalcan't find file sstpdf2.h Pin
Cheng Stone1-May-06 17:51
Cheng Stone1-May-06 17:51 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster1-May-06 18:04
professionalGarth J Lancaster1-May-06 18:04 
GeneralRe: can't find file sstpdf2.h Pin
snacker214-Apr-09 5:04
snacker214-Apr-09 5:04 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster14-Apr-09 11:38
professionalGarth J Lancaster14-Apr-09 11:38 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster14-Apr-09 11:41
professionalGarth J Lancaster14-Apr-09 11:41 
GeneralRe: can't find file sstpdf2.h Pin
snacker214-Apr-09 11:54
snacker214-Apr-09 11:54 
QuestionMerge 2 pdf files ? Pin
dragomir27-Oct-05 2:07
dragomir27-Oct-05 2:07 
GeneralWon't SaveAs, Close, Exit Pin
Adam Hurwitz26-Sep-05 11:04
Adam Hurwitz26-Sep-05 11:04 
GeneralRe: Won't SaveAs, Close, Exit Pin
Adam Hurwitz26-Sep-05 11:20
Adam Hurwitz26-Sep-05 11:20 
GeneralExit command fails Pin
dragomir15-Sep-05 4:04
dragomir15-Sep-05 4:04 
GeneralHiding the Acrobat Application while printing Pin
PC-Alex14-May-05 23:48
PC-Alex14-May-05 23:48 
GeneralRe: Hiding the Acrobat Application while printing Pin
iver18-Aug-05 3:12
iver18-Aug-05 3:12 
GeneralRe: Hiding the Acrobat Application while printing Pin
jly775-Sep-05 16:19
jly775-Sep-05 16:19 
QuestionPrinting problem, is it caused by version 7 ? Pin
PC-Alex28-Apr-05 4:26
PC-Alex28-Apr-05 4:26 
AnswerRe: Printing problem, is it caused by version 7 ? Pin
iver10-May-05 22:02
iver10-May-05 22:02 
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 

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.