Joseph Jones
asked on
Opening of Pdf file with specific page number doesn't work on production environment.
Hi,
The following code works fine to open a pdf file with a specific page number in developer environment but when I install the web application on my local iis machine, the pdf file doesn't open. There is no error message either to trouble shoot. Can you please help on this issue?
Thanks
Joe
Private Sub ShowPDF(intRecID As Integer, intBkRecID As Integer, _
intImageID As Integer, intPdfPageNo As Integer, strFileCode As String)
Dim strJoePath As String = LoadWebImagePath(intImageI D)
Dim myProcess As New System.Diagnostics.Process ()
myProcess.StartInfo.FileNa me = "Acrobat.exe"
myProcess.StartInfo.Argume nts = String.Format(" /A ""page=" & intPdfPageNo & "=OpenActions"" ""{0}""", strJoePath & "\" & strFileCode & ".PDF")
Try
myProcess.Start()
Catch ex As Exception
If ex.Message <> "" Then
Try
If File.Exists(strJoePath & "\" & strFileCode & ".PDF") = True Then
Me.RadWindowManager1.RadAl ert("FILE EXISTS..!!!", 300, 100, "Image Loading", "alertCallBackFn", "/images/Alert.gif")
End If
myProcess.StartInfo.FileNa me = "AcroRd32.exe"
myProcess.StartInfo.Argume nts = String.Format(" /A ""page=" & intPdfPageNo & "=OpenActions"" ""{0}""", strJoePath & "\" & strGRRFileCode & ".PDF")
myProcess.Start()
Catch ex2 As Exception
Me.RadWindowManager1.RadAl ert("FATAL ERROR : " & ex2.Message.ToString & ". ..!!!", 300, 100, "Image Loading", "alertCallBackFn", "/images/Alert.gif")
Exit Sub
End Try
End If
End Try
myProcess.Close()
myProcess = Nothing
End Sub
The following code works fine to open a pdf file with a specific page number in developer environment but when I install the web application on my local iis machine, the pdf file doesn't open. There is no error message either to trouble shoot. Can you please help on this issue?
Thanks
Joe
Private Sub ShowPDF(intRecID As Integer, intBkRecID As Integer, _
intImageID As Integer, intPdfPageNo As Integer, strFileCode As String)
Dim strJoePath As String = LoadWebImagePath(intImageI
Dim myProcess As New System.Diagnostics.Process
myProcess.StartInfo.FileNa
myProcess.StartInfo.Argume
Try
myProcess.Start()
Catch ex As Exception
If ex.Message <> "" Then
Try
If File.Exists(strJoePath & "\" & strFileCode & ".PDF") = True Then
Me.RadWindowManager1.RadAl
End If
myProcess.StartInfo.FileNa
myProcess.StartInfo.Argume
myProcess.Start()
Catch ex2 As Exception
Me.RadWindowManager1.RadAl
Exit Sub
End Try
End If
End Try
myProcess.Close()
myProcess = Nothing
End Sub
If you are trying to load this thru a web browser, I think you will find that you can't launch an EXE on a user machine thru a web browser. That is considered a serious security problem and is blocked by all browsers.
ASKER
Hi Dave,
Is there any way you can suggest to a open pdf file with a specific page?
Thanks
Joe
Is there any way you can suggest to a open pdf file with a specific page?
Thanks
Joe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.