CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2001
    Posts
    3

    Printing Acrobat Dynamically

    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


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Printing Acrobat Dynamically

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


  3. #3
    Join Date
    Oct 2001
    Posts
    3

    Re: Printing Acrobat Dynamically

    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


  4. #4
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Printing Acrobat Dynamically

    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





  5. #5
    Join Date
    Oct 2001
    Posts
    3

    Re: Printing Acrobat Dynamically

    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


  6. #6
    Join Date
    May 2002
    Location
    CANADA
    Posts
    55
    You cant reference pdf.ocx. you must add it as an ActiveX component.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured