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