Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-11-22 03:42:32

Bernhard
Member
Registered: 2007-11-22
Posts: 0

Print Pdf-Files from C++ applikation

Hi,
i try to print something directly from a C++ applikation (VS6.0, Microsoft XP).
I tried to use the Adobe Printer, but that doesn`t work (Acrobat Reader can`t open the file).
I wrote the following code:

////////////////////////////////////////////////////////////////
DOCINFO dci1;   // write file
T_LONG dret;
CDC dcPrint;
// DocInfo for Spooler/

//Real printer------------------------------------------------
//      dci1.lpszDocName = "C:\\Hallo";
//      dci1.lpszOutput = NULL;  //"OutputFile1";

//Adobe---------------------------------------------------------         dci1.lpszDocName = "";       
         dci1.lpszOutput = "D:\\Test.pdf";  //"OutputFile1";
 
         dci1.lpszDatatype = NULL;
////////////////////////////////////////////////////////////////
Using the real printer works.

Is it possible to create a PDF-File in an other way? Can I use special DLLs? Can you tell me where I got the needet information, please?

Thank you,
Bernhard


My Product Information:
Reader Standard 7 / Windows

Offline

 

#2 2007-12-06 16:24:58

thomp
Member

Registered: 2007-04-23
Posts: 1005

Re: Print Pdf-Files from C++ applikation

To print a PDF file from your program you have to engage an application that can do this, i.e. Reader or Acrobat Pro. There are 2 simple methods.   

1.  Force the system to execute Acrobat/Reader from the command line with the proper command line options for printing.  On windows use "ShellExecute()".  Of course, for this you have to detect and locate either Reader or Acrobat first.

2.  Use the Acrobat IAC interface to do the printing.  This is be far the best option.  You'll find the documentation here. 

http://www.adobe.com/devnet/acrobat/

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in