[dba-VB] Open PDF file

Gustav Brock Gustav at cactus.dk
Mon Nov 26 08:48:15 CST 2007


Hi Jim

You may be right - I didn't read the question in full, I can see now, sorry.

However, there seems to be some misunderstanding ... the user's browser can open an pdf file if the Adobe Reader add-in is installed, but the file is downloaded from the web server; as far as I know, the server can not "display" an pdf file, only pass it on.

/gustav

>>> JHewson at karta.com 26-11-2007 15:37 >>>
Doesn't the PDF reader need to be on the user's machine?
How does this open a file on a server so the user, presumably somewhere else, open the file and review it?
I thought the user must have Adobe reader on their machine.

Jim 
jhewson at karta.com 
 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Monday, November 26, 2007 7:43 AM
To: dba-vb at databaseadvisors.com 
Subject: Re: [dba-VB] Open PDF file

Hi David

This works for me having Acrobat Reader as the default viewer in Windows:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim runPdf As New System.Diagnostics.Process
        Dim fileName As String = "c:\test.pdf"

        runPdf.StartInfo.FileName = fileName
        runPdf.StartInfo.WindowStyle = ProcessWindowStyle.Normal
        runPdf.Start()
        runPdf.WaitForExit()
        runPdf.Close()

        runPdf = Nothing
    End Sub

/gustav

>>> newsgrps at dalyn.co.nz 26-11-2007 06:14 >>>
I am using VS 2005 and VB.Net for a web site.

I have a number of PDF files that are stored in a static folder on the server.

Users select from a list on files on a web page and I want to open 
the files in Adobe.  Adobe reader is installed on the server.

Can anyone give me a pointer to how I can take a string with path and 
file name, and open it?

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand 






More information about the dba-VB mailing list