Click to See Complete Forum and Search --> : Printing Acrobat Dynamically


duttasurajit
October 3rd, 2001, 01:56 AM
Hi,
I have a web page, I press a print button from that web page,then a pdf(acrobat) file will get populated with field values from the database at the background and the generated acrobat should be printed. The generated acrobat should not be displayed to the user. I am able to populate the acrobat fields using FDF toolkit(using OLE automation) now I need to print this dynamically generated pdf file,Need to know how this printing can be achieved .
Thanks,
Surajit

DSJ
October 3rd, 2001, 02:24 PM
In your acrobat directory there should also be an "ActiveX" directory. In there is a PDF.OCX control. One of it's methods it "Print"....

duttasurajit
October 4th, 2001, 01:16 AM
Hi,
Yeah there is a PDF.OCX control, can you
help me with some code samples as to what to
do,I am new to Activex ,
Thanks ,
Suraj

DSJ
October 4th, 2001, 08:10 AM
After you've added a reference to the OCX, place one on your form. Add a command button and try this code:



private Sub Command1_Click()
'put whatever filename you want to print...
Pdf1.LoadFile ("C:\program files\adobe\acrobat 4.0\reader\readme.pdf")
Pdf1.printWithDialog
'or
'pdf1.print
'pdf1.printall
'or whatever options you wish...
End Sub

duttasurajit
October 8th, 2001, 02:06 AM
Hi ,
Tried your code but could not set a reference
to pdf.ocx and what should I instantiate
through createobject method.
Like for word we have
Set mydoc = Createobject("Word.Application")
Pls let me know about this.
Thanks,
Suraj

treitus
August 19th, 2002, 05:46 PM
You cant reference pdf.ocx. you must add it as an ActiveX component.