364,088 Members | 5493 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Display And Embed PDF in the browser

phoenie
P: 12
Coding in vb, framework .net 2.0, vs2005

When an user want to click on to view the report which is in the .pdf format,
I will be able to display the file and embed it in the browser.

What codes should i include?
Aug 14 '08 #1
Share this Question
Share on Google+
14 Replies


Curtis Rutland
Expert Mod 100+
P: 2,045
Well, if they have the proper reader installed, you can just link to the PDF. It will be displayed in the embedded PDF reader.
Aug 14 '08 #2

phoenie
P: 12
Well, if they have the proper reader installed, you can just link to the PDF. It will be displayed in the embedded PDF reader.
i am sorry...i cant catch what you mean...what is the "proper reader" u meant?
can give some examples?

well...i want to display the pdf file in browser, but not open the pdf file like using Adobe...example as link below:

http://www.beansoftware.com/ASP.NET-Tutorials/PDF-View-Custom-Control.aspx

but unfortunately i cannot run the program successfully...
there have some problem on the library...

thanx...
Aug 14 '08 #3

Curtis Rutland
Expert Mod 100+
P: 2,045
Well, I meant Adobe Reader. Maybe somebody else knows more. Did you try to follow the tutorial you linked step by step?
Aug 14 '08 #4

phoenie
P: 12
Well, I meant Adobe Reader. Maybe somebody else knows more. Did you try to follow the tutorial you linked step by step?
Yes...i do follow the tutorial step by step, debug it line by line...
that why only figure out the ShowPDF.dll is refer to the C:\\Scott.....

By the way...
I've tried other method...
When i try to add the reference named acrobat.dll in my project
but my toolbox do not appear its components...
do you have any idea what going wrong?
Aug 14 '08 #5

Curtis Rutland
Expert Mod 100+
P: 2,045
I don't have access to my test PC right now (stuck on my mac right now) but check in tomorrow, I should be able to help once I get my PC set up again.

The general idea is that you don't need to add a reference, you need to right click in the toolbox and choose components, and look through the COM objects to find Adobe Reader.
Aug 14 '08 #6

phoenie
P: 12
I don't have access to my test PC right now (stuck on my mac right now) but check in tomorrow, I should be able to help once I get my PC set up again.

The general idea is that you don't need to add a reference, you need to right click in the toolbox and choose components, and look through the COM objects to find Adobe Reader.
Really million thanx for your help....

I've tried "dig through" the toolbox,
still cant find any components for AdobeReader
Aug 14 '08 #7

DrBunchman
Expert 100+
P: 890
Not sure if I'm missing the point here but if the client machine has at least got Adobe Reader installed then you can use the <iframe/> tag to embed a pdf can't you?
Expand|Select|Wrap|Line Numbers
  1. <iframe src="PDFDirectory/Test.pdf"></iframe>
Just set up PDFDirectory as a virtual directory in your IIS and you should be able to point to it as above.

Hope this helps,

Dr B
Aug 14 '08 #8

phoenie
P: 12
Not sure if I'm missing the point here but if the client machine has at least got Adobe Reader installed then you can use the <iframe/> tag to embed a pdf can't you?
Expand|Select|Wrap|Line Numbers
  1. <iframe src="PDFDirectory/Test.pdf"></iframe>
Just set up PDFDirectory as a virtual directory in your IIS and you should be able to point to it as above.

Hope this helps,

Dr B
thanx for your input...
But now I do not have virtual directory yet...
So what should I do?
(I am sorry...I am a newbie..so may be lot easy question cant understand by me)
Aug 14 '08 #9

DrBunchman
Expert 100+
P: 890
Sorry phoenie, ignore the part about virtual directories for now.

Just put the unc of the pdf into the src property of the iframe tag and it should embed. e.g.
Expand|Select|Wrap|Line Numbers
  1. <iframe src="\\servername\sharename\folder\test.pdf" height="100" width="200"></iframe>
Hope this helps,

Dr B
Aug 14 '08 #10

phoenie
P: 12
Thanx again for your helping hand...

I've tried on your codes...
It really helped me...

now the next step I need to do is:
How to disable the print icon in the Adobe reader when displaying the .pdf file?
Aug 15 '08 #11

Plater
Expert Mod 5K+
P: 7,575
How to disable the print icon in the Adobe reader when displaying the .pdf file?
The availablitiy of the print button in a pdf file is a security property in the PDF file itself. If you want the button disabled, you will need to generate the pdf with the correct security settings.
You should take note though that just because you set that security feature, does not mean that pdf readers have to abide by it.
Aug 15 '08 #12

DrBunchman
Expert 100+
P: 890
As I mentioned in another thread recently, if you are concerned about people 'stealing' your pdf's then you should consider watermarking them or reducing the resolution so they are only suitable for previews.

Dr B
Aug 15 '08 #13

phoenie
P: 12
The availablitiy of the print button in a pdf file is a security property in the PDF file itself. If you want the button disabled, you will need to generate the pdf with the correct security settings.
You should take note though that just because you set that security feature, does not mean that pdf readers have to abide by it.
what are the security features that I need to set?
thanx in advance
Aug 18 '08 #14

phoenie
P: 12
As I mentioned in another thread recently, if you are concerned about people 'stealing' your pdf's then you should consider watermarking them or reducing the resolution so they are only suitable for previews.

Dr B
Em...this requirement is request by the client...
The system need user to log in before using it...
then will keep track the log in id to see the user has the privillege to print it...
maybe we cant prevent from others to print down the document...
but at least can make a little control telling that user he/she does not has the right to print...

ya...i jz have another thinking...
convert the pdf file to TIFF file
since the file only has 2 types, TIFF and pdf
is it a good idea?possible?
Aug 18 '08 #15

Post your reply

Help answer this question



Didn't find the answer to your .NET Framework question?

You can also browse similar questions: .NET Framework