Click here to Skip to main content
15,072,735 members
Articles / Programming Languages / C++
Article
Posted 9 Nov 2004

Stats

176K views
2.3K downloads
40 bookmarked

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

Share

About the Author

seasidetech
Instructor/Trainer
France France
No Biography provided

Comments and Discussions

 
GeneralIs there any way to search and locate inside acrobat reader control Pin
Member 48506929-May-10 0:37
MemberMember 48506929-May-10 0:37 
GeneralFailed to build this code with VS 2003 C++ Pin
Monkeyhorse12-Jan-10 7:08
MemberMonkeyhorse12-Jan-10 7:08 
QuestionHow to do the same in C# Pin
PooranPrasad4-Oct-09 20:18
MemberPooranPrasad4-Oct-09 20:18 
GeneralFilePrintSilent - Synchronous/Serialize Pin
topperpbb22-May-06 3:27
Membertopperpbb22-May-06 3:27 
Generalcan't find file sstpdf2.h Pin
Cheng Stone1-May-06 17:51
MemberCheng Stone1-May-06 17:51 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster1-May-06 18:04
mveGarth J Lancaster1-May-06 18:04 
GeneralRe: can't find file sstpdf2.h Pin
snacker214-Apr-09 5:04
Membersnacker214-Apr-09 5:04 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster14-Apr-09 11:38
mveGarth J Lancaster14-Apr-09 11:38 
GeneralRe: can't find file sstpdf2.h Pin
Garth J Lancaster14-Apr-09 11:41
mveGarth J Lancaster14-Apr-09 11:41 
GeneralRe: can't find file sstpdf2.h Pin
snacker214-Apr-09 11:54
Membersnacker214-Apr-09 11:54 
QuestionMerge 2 pdf files ? Pin
dragomir27-Oct-05 2:07
Memberdragomir27-Oct-05 2:07 
GeneralWon't SaveAs, Close, Exit Pin
Adam Hurwitz26-Sep-05 11:04
MemberAdam Hurwitz26-Sep-05 11:04 
GeneralRe: Won't SaveAs, Close, Exit Pin
Adam Hurwitz26-Sep-05 11:20
MemberAdam Hurwitz26-Sep-05 11:20 
GeneralExit command fails Pin
dragomir15-Sep-05 4:04
Memberdragomir15-Sep-05 4:04 
GeneralHiding the Acrobat Application while printing Pin
PC-Alex14-May-05 23:48
MemberPC-Alex14-May-05 23:48 
GeneralRe: Hiding the Acrobat Application while printing Pin
iver18-Aug-05 3:12
Memberiver18-Aug-05 3:12 
GeneralRe: Hiding the Acrobat Application while printing Pin
jly775-Sep-05 16:19
Memberjly775-Sep-05 16:19 
QuestionPrinting problem, is it caused by version 7 ? Pin
PC-Alex28-Apr-05 4:26
MemberPC-Alex28-Apr-05 4:26 
AnswerRe: Printing problem, is it caused by version 7 ? Pin
iver10-May-05 22:02
Memberiver10-May-05 22:02 
GeneralRe: Printing problem, is it caused by version 7 ? Pin
PC-Alex14-May-05 23:38
MemberPC-Alex14-May-05 23:38 
GeneralVB.Net HowTo Pin
steel123425-Mar-05 4:38
Membersteel123425-Mar-05 4:38 
GeneralRe: VB.Net HowTo Pin
yltsa30-Apr-05 4:31
Memberyltsa30-Apr-05 4:31 
Generalhelp Pin
robig22-Mar-05 0:23
Memberrobig22-Mar-05 0:23 
GeneralRe: help Pin
bjw04-Aug-05 7:01
Memberbjw04-Aug-05 7:01 
GeneralRe: help Pin
bjw04-Aug-05 7:13
Memberbjw04-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.