The suggestion that worked was to use an Iframe, and set it's src attribute to the document link. (read for more about
iframes). This was dead easy as long as I had a constant for the name of the document, but there was a bit of bother setting the src attribute
from the program until Haissam showed me how to do this.
I was using this for a .htm document, but it would work equally well for .doc, .pdf, or anything that the client computer can handle.
Hi I am Arun Prasad.B from India. I want to display pdf in asp.net with disabling the printing and save options in pdf viewer. As well as I want to restrict the context menu in Pdf Viewer. If any one knows please guide me.
) to display different documents on the iframe based on what the user wants to see. for example affter a user has selected some option from a drop downlist the iframe shoul display the pdf document related to their option. please help.
Thanks for this post. I have an application which I developed in 2007 in ASP.NET 2.0 framework.
There is a need for the application to display PDF file for user preview, which I did using iframe as you adviced.
But when file to be displayed is downloaded by the application, users will have to click the refresh button on the web browser before the current PDF file is displayed, sometimes it doesn't work.
Please, what can I do to ensure that once the page is loaded, the correct file displays.
The correct file is actually downloaded, because when I go in to the folder where the downloaded file is, it is the one requested that I see there.
Robert Barne...
Member
451 Points
707 Posts
Re: How to display a pdf document inside a web form?
May 01, 2007 05:23 AM|LINK
This sounds like a problem that I had, http://forums.asp.net/thread/1644404.aspx
The suggestion that worked was to use an Iframe, and set it's src attribute to the document link. (read for more about iframes). This was dead easy as long as I had a constant for the name of the document, but there was a bit of bother setting the src attribute from the program until Haissam showed me how to do this.
I was using this for a .htm document, but it would work equally well for .doc, .pdf, or anything that the client computer can handle.
Cheers, Robert
Jeethu
Member
87 Points
18 Posts
Re: How to display a pdf document inside a web form?
May 04, 2007 10:27 AM|LINK
The most simple solution for this is create a simple iframe ans set the source pdf , it will load inside the webform [:)]
snippet :
<
iframe src="acrobat.pdf" style="z-index: 100; left: 27px; width: 671px; position: absolute; top: 130px; height: 502px"></iframe>Jeethu Joseph
IIS/Asp.Net Engineer Microsoft.
ave_prasad
Member
2 Points
1 Post
display a PDF for visual guidance
Sep 15, 2008 10:10 AM|LINK
Greetings,
Hi I am Arun Prasad.B from India. I want to display pdf in asp.net with disabling the printing and save options in pdf viewer. As well as I want to restrict the context menu in Pdf Viewer. If any one knows please guide me.
Regards,
Arun Prasad.B
thusharapp
Member
2 Points
1 Post
Re: display a PDF for visual guidance
Sep 15, 2008 10:29 AM|LINK
Hi,
I want to display pdf in asp.net with disabling the printing and save options in pdf viewer.Plz help
Regards
pp
truongthang
Member
18 Points
41 Posts
Re: display a PDF for visual guidance
Oct 17, 2008 07:04 AM|LINK
Can you try to use this open source control.
http://www.beansoftware.com/ASP.NET-Tutorials/PDF-View-Custom-Control.aspx
Email: truongthang_ad@yahoo.com
yogarajan143
Member
27 Points
18 Posts
Re: display a PDF for visual guidance
Dec 06, 2008 10:39 AM|LINK
hi friends
do u have any solution in asp.net with pdf and print and save as property disable
i need very urgent
pls help me
LucBite
Member
9 Points
14 Posts
Re: How to display a pdf document inside a web form?
Jul 02, 2009 09:08 AM|LINK
I want to use your solution(
snippet :
<
iframe src="acrobat.pdf" style="z-index: 100; left: 27px; width: 671px; position: absolute; top: 130px; height: 502px"></iframe>Jeethu Joseph
) to display different documents on the iframe based on what the user wants to see. for example affter a user has selected some option from a drop downlist the iframe shoul display the pdf document related to their option. please help.
srinivaskotr...
Star
11228 Points
1792 Posts
Re: display a PDF for visual guidance
Jul 02, 2009 09:23 AM|LINK
Hi,
to open pdf file
Response.Clear();
string filePath = ur file path on the server
Response.contentType = "application/pdf";
Response.WriteFile(filePath);
http://guydotnetxmlwebservices.blogspot.com/
asp.net with pdf and print and save as property disable this is your post
Not posible since that's the browser property. what you can only do is add a watermark to the PDF so that it becomes unusable
http://www.codeproject.com/KB/aspnet/Creating_PDF_documents_in.aspx
Srinivas Kotra.
s_luckman1
Member
2 Points
1 Post
Re: How to display a pdf document inside a web form?
Apr 07, 2010 08:43 AM|LINK
This way it works
Dim filePath As String = fulluploadpath
Response.ContentType = "application/pdf"
Response.WriteFile(filePath)
place the above code in pageload in webform2.aspx
Response.Clear()
Response.Write(Session("pdfFileName"))
Response.Redirect("DisplayPDF.aspx")
Working as expected, I mean the back button is working.
bioscom
Member
12 Points
11 Posts
Re: How to display a pdf document inside a web form?
Jul 15, 2010 03:00 PM|LINK
Hello,
Thanks for this post. I have an application which I developed in 2007 in ASP.NET 2.0 framework.
There is a need for the application to display PDF file for user preview, which I did using iframe as you adviced.
But when file to be displayed is downloaded by the application, users will have to click the refresh button on the web browser before the current PDF file is displayed, sometimes it doesn't work.
Please, what can I do to ensure that once the page is loaded, the correct file displays.
The correct file is actually downloaded, because when I go in to the folder where the downloaded file is, it is the one requested that I see there.
Thank you.