Opening PDF within a Windows Form

  • Thread starter Thread starter Wei.Cheng
  • Start date Start date
Hi:

System.Diagnostics.Process.Start("acroRd32", Application.StartupPath +
"\\" + "report.pdf");

Not sure if this is the best way though!

HTH!
Sk&y;
 
You can also use the Adobe Acrobat x.x Browser Document control (activex -
acroPDF.dll). I would definitely not use the first suggestion as it assumes
Acrobat is installed and will not display a meaningful message to the user if
it fails. The problem with the solution below is that you are then hosting a
browser control and the browser control is then hosting a AcroPDF.PDF.1
(ProgID) control so you are actually using two controls to accomplish one
task when one of the controls is simply a container. There is nothing wrong
with this approach necessarily but if you might be worried about performance
this could be a source of problems (probably not on most machines but it
could be). My 2 cents.
 
yoga said:
You can also use the Adobe Acrobat x.x Browser Document control
(activex - acroPDF.dll). I would definitely not use the first
suggestion as it assumes Acrobat is installed and will not display a
meaningful message to the user if it fails.

If files are on a local (or network) drive it's OK.
If files are on a remote server WebBrowser is better solution.

In my system I was using both, had some problems with WebBrowser and
replaced it with acroPdf but now I have to download remote files myself
and the users started to complain about the response time. Reader v7
will show the first page of some pdf files (I think PDF-1.5 or higher)
withing a second or two. If I have a big file (>50 pages) it takes
about 20 second to download the whole file. In case of 167 pages it was
more than a minute. When I was testing I was using local link to the
server so all was OK (under 4 secs).

MH
 
Hi,
In my system I was using both, had some problems with WebBrowser and
replaced it with acroPdf but now I have to download remote files
myself and the users started to complain about the response time.

I have never used acroPDF.dll, but in Acrobat you can open a document
from an URL. Perhaps you can use the acroPDF.dll to open that url
internally, then it might come up with showing the first page just after
seconds and downloading the rest while viewing... but it's just a guess.

btw: displaying the first pages while downloading the rest of the pdf
document is only possible, if the pdf has been saved with the option
"optimize for webviewing".

hth
Markus
 
Markus wrote:

btw: displaying the first pages while downloading the rest of the pdf
document is only possible, if the pdf has been saved with the option
"optimize for webviewing".

Thanks.

MH
 
Back
Top