Results 1 to 3 of 3

Thread: printing PDF documents?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2004
    Posts
    59

    printing PDF documents?

    Hello everyone, How would I go about printing PDF documents? I have all the paths to the pdf files I want to print in an Array declared as "ArrayPDF"

    Here is what I have so far:

    code:

    Private Sub print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles print.Click

    PrintDialog1.Document = PrintDocument1
    PrintDialog1.ShowDialog()

    Dim r As DialogResult = PrintDialog1.ShowDialog

    If r = DialogResult.OK Then
    PrintDocument1.Print()
    End If

    End Sub



    So what this does is just show the print dialog screen. How would I tell the printer to print those pdf files? Thanks

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,526

  3. #3
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036
    Hi

    You need Adobe acrobat installed on your computer to use the following code ...
    Code:
       
    Dim strFile As String = "c:\teste.pdf"
           Dim objProcess As New System.Diagnostics.ProcessStartInfo
    
            With objProcess
                .FileName = strFile
                .WindowStyle = ProcessWindowStyle.Hidden
                .Verb = "print"
                .UseShellExecute = True
            End With
            Try
                System.Diagnostics.Process.Start(objProcess)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

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