How to show Sharepoint document in ASPX page?

Hi Experts,

  There is a requirement for me. I've sharepoint site. In the document library, some documents are loaded.

  The documents full searchable path is loaded as hyperlink in my ASPX page. This is achieved.

  Upon clicking the link, what I would like to do is that I would get the content and write in an ASPX page. How to achieve this? Please guide me.
LVL 16
Easwaran ParamasivamAsked:
Who is Participating?
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Please try to understand:

A PDF stored in a SharePoint library is still a PDF. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a PDF. This question relates to accessing PDF content with .Net.

A Word document stored in a SharePoint library is still a Word document. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a Word document. This question relates to accessing Word content with .Net

A HTML file stored in a SharePoint library is still a HTML file. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a HTML file. This question relates to accessing HTML content with .Net.

All this has nothing at all to do with how SharePoint works. SharePoint is (I hate to say this) just a platform. The documents retain their characteristics, even if they are stored in a SharePoint library.

For all it's worth, you can open the SharePoint library with Windows Explorer and use the SharePoint location as a file path, just like any other network drive.

In this context, the way you phrased your question does not make sense. This is not "how can I display the content of a SharePoint document in a different setting". You need to ask several different questions, e.g.

- how can I extract the contents of a Word document to display in a different setting
- how can I extract the contents of a PDF document to display in a different setting
- how can I extract the contents of a HTML file to display in a different setting

Since the three file types you listed are of a completely disparate nature, you should post three different questions in the respective topic areas.

Again: this is not about SharePoint. It's about how to access file contents of different file types with .Net.

regards, teylyn
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

whilst it is possible to upload all kinds of documents to a document library, whether or not the content of these documents can be displayed in a browser is a completely different subject.

What document types does the library contain? SharePoint has some built-in functionality to display certain file types out of the box. For example Excel files can be shown with Excel Services, if they adhere to certain constraints. Similarly, Visio files can be shown in a web part. Office web apps can be used to show other Office documents. PDFs can be shown in the browser as well,

Other file types are not so easy to integrate, for example AutoCAD drawings.

Reading the contents of a file and displaying it in an ASPX page sounds like a major undertaking that very much depends on what type of file you want to open.

Can you elaborate on that?

cheers, teylyn
0
 
Easwaran ParamasivamAuthor Commented:
Thanks.

We have docx, pdf and html files.

Please explain how to handle each of them.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
The browser will be able to display PDFs (any browser has a PDF plug-in) and HTML goes without saying. Word documents can open in Word. Why do you want to re-invent the wheel?

Just let the files be opened with the tools that are made to handle them.
0
 
Easwaran ParamasivamAuthor Commented:
Thanks.

My question is how to get content of the specified file (by passing file path) from sharepoint.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Can you explain the bigger picture? Word, PDF and HTML are three completely different file formats, so need to be treated differently. Why do you want to "read" the content of the files if you can just open them in the browser?
0
 
Easwaran ParamasivamAuthor Commented:
Well. Why I need to read the content is that say for example the document stored in Sharepoint is DOC or DOCX file. There is an option that I need to provide, I would like to show the Document content in HTML format (The para content will be shown with in <p></p> tag). If I read the content only I could do some manipulation on it.

Please let me know if you need further details.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Well, all these document types can be displayed in the browser.  Why re-invent the wheel? For Word documents just set the library to open documents in the browser instead of the client. HTML and PDFs are already taken care of.
0
 
Easwaran ParamasivamAuthor Commented:
In web application it is OK. What about in case of windows application as Client. Say for example, in a Rich text box I would like to shown the content of a sharepoint document. In this case I could able to read the sharepoint document content. Right?

Please direct me how to achieve that.

Thanks.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
There is no such thing as a "SharePoint document". SharePoint is not a file type. SharePoint document libraries can store all kinds of files. The file type is not tied to SharePoint but inherent in the file and any method to show the file content in a different setting is independent of SharePoint.
0
 
Easwaran ParamasivamAuthor Commented:
The Sharepoint document I meant is the document stored in sharepoint. You are right. There should be some method in .NET to fetch the document by some means connecting with Sharepoint. I would like to know that. Please share with me your thoughts/ideas/suggestions.

Please let me know if you need further details.
0
 
Easwaran ParamasivamAuthor Commented:
Thanks for your response. I got your point.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Can you please explain the B grade? This is the second time you assigned a B grade to one of my answers. My answers are valid. You can't assign a B simply because you don't like how things work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.