This should work for you. Use this to call
VB Code:
Try
Print.PrintPDF("C:\mypdffile.pdf")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
This
VB Code:
Imports System.IO
Imports System.Runtime.InteropServices
Public Class Print
Private Const SW_SHOWNORMAL As Integer = 2
<DllImport("shell32")> _
Private Shared Function ShellExecute(ByVal hWnd As IntPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Integer) As IntPtr
End Function
Public Shared Sub PrintPDF(ByVal FilePath As String)
If IO.File.Exists(FilePath) Then
If ShellExecute(CType(1, IntPtr), "Print", FilePath, "", _
Directory.GetDirectoryRoot(FilePath), SW_SHOWNORMAL).ToInt32 <= 32 Then
Throw New Exception("Error: The file did not print.")
End If
Else
Throw New Exception("Error: The file does not exist.")
End If
End Sub
End Class
After reading nbrege's post I am wondering if I misunderstood the original request. Are you trying to do this without having Adobe (or equivalent) installed on the client machines?