Click here to Skip to main content
11,928,786 members (46,041 online)
Rate this:
Please Sign up or sign in to vote.
Dear all,

I am building a windows forms application where people can view PDF (preview).
I am successfully able to locate a file on the local computer and preview this in the PDF viewer control.

What I want to do is:

My file is located on an internet location which you can point to as:

I am aware that I can download the file and then preview it to the viewer control. I do not want to do this due to random files and number of files to be downloaded on local computer and for privacy reasons.

Can anyone suggest an idea that if I can reference the document to the PDF viewer control as the above path?

Also my other other question is:

This PDF viewer control works only if I put x86 in the build options for this windows forms application. I want it for any CPU.

Please help.


Posted 2-May-13 19:43pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I found that this is possible with PdfSharp. Please see:[^],[^].

Some code sample demonstrating a PDF viewer using this library and System.Windows.Forms can be found in Google Code:[^].

Nayan Ambaliya 3-May-13 2:01am
Thanks you very much...
Sure. Will you accept the answer formally (green button)?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Well, one way or another it has to be downloaded to be viewed. A program can't work with data it doesn't have. Every file you view in your web browser (e.g. images, video, documents) has to be downloaded to your machine first, the only difference is it goes somewhere temporary where it will be deleted when it's no longer needed.

That said, what you could do is have the user install a PDF viewer with an IE compatible plug-in (in the off chance they don't already have one), and display it via a Web Browser control instead, which should forward it to the PDF viewer plug-in. It doesn't seem very elegant to me, but it does work. The other option is to download it to a temporary file, use it as you normally would, then delete it when you're done.
Nayan Ambaliya 3-May-13 2:02am
Thank you very much...
But the web browser control has the limitation of 32 bit and 64 bit machines by its own...
I think I will have to download and delete it as done..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100