Thursday, 28 June 2012

How to embed PDF and text file contents in sharepoint pages

Hi,

I was presented a requirement where some of the site administrators wanted to show contents from PDF and text files to many pages in our sharepoint sites. The content was either text or images. There is always a way to add this under the page controls and pods but it was not an effective way of doing so since for any change in the requirement it has to be carried out in all pages manually. Hence I used the content editor webpart to display the text. The file was stored in a document library and it was being referred by my content editor webpart so any changes in the file will be reflected in my pages as well. To refer the file in my content editor webpart I used the following script in source editor of my webpart :


<iframe width="560" height="345" src="FileUrl" frameborder="0" ></iframe>


Thats it and it worked out


I hope this will help you out.


Thanks,
Rahul Rashu


No comments:

Post a Comment