Word file Viewer in wordpress - wordpress

I am using Karma commercial template. I have make the plugin for to upload document or any type of file, which will save in database and give option of Preview in front end. I have search many plugins for the same. I don't want to download the file but only wanted to preview the file in read only mode.Please help for the same.

I have used javascript code using javascrip plugin:
var documentViewer = $('#document-preview').documentViewer();
But it is not usefull for word file as it is useful for image, pdf and text file.

The Google Document Embedder plugin allows you to display files (PDF, Word, etc.) and has options that will prevent downloads.
http://wordpress.org/plugins/google-document-embedder/

Related

Reading an e pub file

I have files in e pub format. I have to show their contents to the user. How do I read them in asp.net? Can it be done through javascript?
Authoritative? What could be better then a StackOverflow answer? I started from this question ( https://stackoverflow.com/questions/4870594/is-there-a-c-sharp-epub-library ) and gleaned a few usefull links:
Usefull information on displaying text in a web browser using javascript so it paginates nicely: HTML book-like pagination
A C# open source library for reading ePub files, the sample code on the home page includes how to get the contents as HTML: http://epubreader.codeplex.com/
There are other libraries which may come in handy if the ePub reader library on codeplex doesn't pan out: http://sourceforge.net/projects/epubsharp/, and http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx
You can't do this with just JavaScript of course, you'll have a server side like a web service or code behind on your asp.net webpage which opens the epub file, extracts the contents as HTML and returns it to the client, but I think there is enough here to get you started.
Just to add then i suggest the steps:
Step 1: unzip the file using C#,.net code having some third party library.
Refer : recommend a library/API to unzip file in C#
Step 2: Check whether in the extracted folder there is only one file or more.
Refer: How do I find out how many files are in a directory?
Step 3 :Read the file using stream reader in c#.net
Refer: http://msdn.microsoft.com/en-us/library/aa328963(v=vs.71).aspx
http://www.dotnetperls.com/streamreader
Epub file is actually a zip archive that contains
xml files for meta data, table of contents etc
xhtml or dtbook (xml) + gif, jpeg, png, svg + css for content
To be able to display epub you will have to be able to handle all of the above. Here Reading ePub format you'll find what you have to do to open epub step by step - it's an example for iphone, but it should be enough.

load a Word document inside an iFrame

I am trying to load a Word document inside ASP.NET page, but it is getting opened through Word that is installed in machine.
Can anyone provide some info on how to load a Word document inside an iFrame?
Would it not be easier to export the file using word and upload it as a pdf and embed it on page as an object.
http://www.ehow.com/how_5775382_load-pdf-within.html
It is not possible directly..
you can try this way
for just displaying documents in browser without needing user to have office installed, u can use google doc viewer or zoho doc viewer
http://docs.google.com/viewer
https://viewer.zoho.com/home.do
hope this helps...

Wordpress Plugin Generating PDF and Xls Documents

I'm writing a web application for a client that needs to be packaged in a wordpress plugin. The application is built on top of a soap api that returns an array of results that I need to output to a pdf and/or excel document. I'm using two third party libraries to generate the pdf and excel files (tcpdf and phpexcel), but Wordpress won't allow them to modify the header from inside of the plugin to return different types of content. Does anyone know how I can generate and return a pdf/excel document from inside of a Wordpress plugin?
Please refer following TCPDF exmaple link...this will show you how to create pdf using TCPDF.
http://www.tcpdf.org/examples.php
You can also refer post2pdf-converter wordpress plugin which will show you how to convert posts to pdf.
http://wordpress.org/extend/plugins/post2pdf-converter/

Adding image to project description in google code

I want to update a background image in google code projects.I searched their wiki, it talks about pointing image to an external world.Is there anyway we can upload the image to google code and provide a link?
I got the solution.First you need to upload the image to 'Download' area.After that, give the image url like this.
<img src="http://yourgoogleproject.googlecode.com/files/name of your image.PNG" alt="Logo"/>
You have to paste the above code inside apostrophe(') and end with apostrophe and can paste this in project description of your project summary tab.(I have just added here, in my case)
The file uploaded will go under 'files' folder of your project automatically.
This answer is no longer correct. Google Code removed the downloads option in May 2013, due to misuse. You can, as they suggest, move your files to Google Drive and link to them from there, which is fine for project downloads, but for items such as images in wiki pages or the project home page, I recommend checking the images into your source repository and linking to them. For example, ig you use a mercurial repository and your files are checked into docs/images, then:
http://yourproject.googlecode.com/hg/yourproject/docs/images/logo.png
should work.

Using PDF In .Net App

Can someone point me to some code/tutorial on how to upload pdf files and store them, then moreover how to use a pdf reader to display the file as read only in an asp.net application.
Is there a PDF reader already in the visual studio toolbox?
The approach I would use in this situation is to upload the PDF as you would any other file, then use a tool like GhostScript to convert the PDF pages into image files that you can show in ASP .Net.
Here's a tutorial doing that in C# http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
Adobe provides (on acrobat.com) a free service which provides you with the ability to upload pdf (and also other types like doc...) and then embed a nice flash interface for displaying the files on your page.
It's pretty helpful as you can store some 5 gigs of files here.
But if you want to let the users upload their own files then this won't help you.
PDF is a final format file, ie its is read-only for the most part and can be embedded into the page via the <object> tag, except if you mean downloadable by the user.
Displaying PDF is generally done by rasterising to an image format for display (ie as an image on the page or via a richer interface (with zooming etc) through flash/silverlight etc.
You can use [GhostScript][1] to interpret PDF files and convert them to an image.
[1]: http://www.GhostScript .com
Uploading a PDF is just like any other file. Use the ASP.NET file uploader control:
http://www.codeproject.com/KB/aspnet/fileupload.aspx
In order to view the PDF in an ASP.NET application, you could either depend on Acrobat being there or use a PDF Viewer control.
The company I work for, Atalasoft, sells a PDF Reader add-on to our web viewer controls. You can learn more here: http://www.atalasoft.com/products/dotimage/pdf-reader

Resources