how to print acrobat .pdf files from vb.net?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: how to print acrobat .pdf files from vb.net?

  1. #1
    Join Date
    Nov 2001
    Posts
    81

    how to print acrobat .pdf files from vb.net?

    hi,

    iam involved in a project which is used to order processing.i have been given a task for opening the pdf files,printing a set(batch if pdf files) automatically without user intervention.

    This type of system is been done in visual foxpro.but its been migrtated to vb.net.

    so its takes a lot **** of time to me to understand the existing foxpro code and do it in vb.net.

    i will tell the process.first a user selects a batch of orders.
    each order contains a set of docuemnts
    once the user selects the batch of orders and says print,its should take each item in the order,(all are having the path in the database),print the pdf file.
    the minimum requirement is we should have the adobe acrobat.

    how to access the acrobat from vb.net,so tha i can print passing the filename,start page,end page like that .how to instantiate and how to use its functionality...

    can some body help me in this regard....

    regards
    varma

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    There are bunch of components (freeware/shareware) that you can use. Adobe themselve should have some component that you can interact with to create/print PDF file. ComponentONE also has .NET component to do the task.

    -Cool Bizs

  3. #3
    Join Date
    Nov 2001
    Posts
    81

    which adobe component to use?

    hi,
    thanks for the reply,
    could you tell me which adobe component to use...
    bcos there are lot of components is there in references....

    regards
    varma

  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    I'm not really sure which is the right Adobe component. At work, we use a component from ComponentOne to create the PDF (and I'm sure that it has a function to print also).

    Adobe Distiller is the engine that creates PDF file. You should be able to check with Adobe web site for more information.

    Also you can search GOOGLE.COM for a shareware/freeware that does the same thing.

    -Cool Bizs

  5. #5
    Join Date
    Nov 2001
    Posts
    81

    how to open the file with adobe type library?

    hi,

    yaa i got the solution for referencing the adobe type library from vb.net.

    now i got a big problem,how i should use this component to open a pdf file and print with out viewing it.

    i used the following code to open

    Dim opDOC As Acrobat.CAcroAVDoc
    Dim ok As Integer


    Try
    ok = opDOC.Open("D:\Varma\Using DataReader.pdf", "TEST")
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    End Try

    but its giving a error,it is
    "object reference not set to instance of an object"

    so how should i create the instance.
    after that how i should print the pdf file in sleep mode..
    if adobe is not installed or pdf files are not there how i should catch and prompt the user..

    please help me..
    regards
    varma

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

    Dim opDOC As Acrobat.CAcroAVDoc

    To:

    Dim opDOC AS New Acrobat.CAcroAVDoc

    to elimiate your error.

    Coolbiz -- Have you had any luck printing to the PDFWriter print driver? I cannot get VS.NET or any application created with it to work. Just end up with garbage in the PDF file. ???

  7. #7
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    DSJ - sorry, I only have to deal with creating the PDF file based on a query from the DB at work and we're using ComponentOne Reporting component to do so.

    -Cool Bizs

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center