Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am creating one application in which admin can change the contents of the pages like About Us, Home, etc. So for this i am using one text editor.But admin wants to upload pdf file with formats defined in pdf.
I am able to open the pdf file in browser but i want the contents with all the formats, to be displayed on asp.net page.

//==================this code is used to display pdf in browser.
C#
string myFile = Server.MapPath("~/Files/sample.pdf");
System.Net.WebClient myWeb = new System.Net.WebClient();
Byte[] myBuff = myWeb.DownloadData(myFile);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", myBuff.Length.ToString());
Response.BinaryWrite(myBuff);

//================

Any help is appreciated.
Thanks in Advanced.
Posted
v2
Comments
Shailesh g 21-Sep-12 1:49am    
its read contents not the real contents...

1 solution

Here you go - How to Display PDF documents with ASP.NET[^].

Just download the files and check the code.
It is exactly what you need. :)
 
Share this answer
 
Comments
Shailesh g 21-Sep-12 5:15am    
Thanks,
But let me tell you that,i don't want to view the pdf in browser. I want the contents of the pdf and want to use in my aspx page.
Now, the question is that is this possible to get contents of pdf with all formatting and can be used on aspx page.
I am using online text editor to format, this solves the formatting of the text to be displayed on the page. But if admin wants to upload formatted pdf and want those contents to be visible on aspx page, then what????.
Thanks

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900