building a document preview webpage - print-preview

Hi i'm wanting to create a webpage in which i can pass a url to a document and it previews it. the idea behind this is so i can create a responsive web view for android so i can preview documents from with an app i have basic knowledge of php and html but if some one could point me in the right direction? i have had a look around but can't find anything that basic i don't need to edit the documents just view them. Does anyone know how to do this?
ps: the docs i want to preview are .xl .xls .doc .docx .pdf .ppt etc

Here is what looks to be a decent open source option.
http://flexpaper.devaldi.com/

One option would be to convert the documents to .pdf first using OpenOffice and then preview them using pdf.js

Related

How to convert PDF web links to file open actions with python pdfrw library

I'm using pdfkit to convert html to pdf which works great, but the external links in the pdf are web links.
The pdf viewer that we are using does not recognize the pdf web links, but file open actions do work.
I've been trying to change the pdf link annotation from a web link to a file open action with the pdfrw library.
I tried to edit the pdf annotation with the following code, but it's not working.
annot.A.update(pdfrw.PdfDict( S='/Launch'))
annot.A.update(pdfrw.PdfDict( F={}))
annot.A.F.update(pdfrw.PdfDict( Type='/Filespec'))
annot.A.F.update(pdfrw.PdfDict( F='(part-1.pdf)'))
annot.A.pop('/Type')
annot.A.pop('/URI')
The link shows up in the new pdf, but there is no action or destination file associated with it.
So after a similar battle today...
you can't define S='/Launch' as string like that. You have to use:
annot.A.update(pdfrw.PdfDict( S=pdfrw.PdfName('Launch')))
Similarly with filespec etc. You may also need to take the () off the filename - as that seemed to break it, at least in Apple Preview.

iOS - Is there a way to generate a PDF file with layers?

Quick question, that I haven't found a solid answer yet.
Is it possible to generate a PDF in iOS that includes layers, which can then be removed/separated in Photoshop?
What I'm trying to achieve is take a picture with the camera of the phone, then place text over it, submit it as pdf to a customer and then have the customer read the text and remove it.
I can do everything except the layering of the pdf and I have found some hints that this isn't possible to do with the standard iOS library, but I wanted to know if anyone has come across this before.
Thank you.
The standard iOS API for creating PDF files cannot create layers (optional content) in a PDF page.
This library IFXPDFFactory seems to be able to generate PDF files with layers.
PoDoFo and libHaru can also be used to generate PDF files on iOS but I do not know if they support layers.

Opening a TIFF File from the Web Browser

I checked previous questions here on SO but I think I want my functionality to work a little different. I understand that .tif files are not natively supported in Internet Explorer and that an extension, such as AlternaTIFF, are available to remedy this. However, I would like the dialog to show up where the user can either save/open the file on the client side. I know that MS Windows Picture and Fax Viewer can open them, no problems.
The files are located on our servers and this will be an intranet site. Currently, I have a link to the files populate in the view but again, I'd like that option for the user to Save/Open the file.
I'm using MVC, which I'm a little unfamiliar with, and can't seem to figure this one out. Thank you.
You can do an action that returns a tiff by changing the headers so when someone clicks the link the file will get downloaded or using FileResult.
Example with FileResult (i find it easier): http://www.dotnetcurry.com/ShowArticle.aspx?ID=807
For saving them is just like uploading any file with MVC. This post can be useful http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
My advice is that you convert them to .jpg or .png when uploaded using GDI+.
//You first upload the tiff to the server like the post above explains
//And then open and convert it to .JPEG
Bitmap bm = Bitmap.FromFile("mypic.tiff");
bm.Save("mypic.jpg",ImageFormat.JPEG);
And if you already have the urls of all the tiffs, you can always do a console app to convert all of them. Even if you need to use tiffs its a good idea to have .jpg versions to show on the web. You can even resize them to create previews and save some bandwith too! :-)

How to fill the fillable PDF in iPhone?

PDF Expert is an iPhone application that enables user to fill the editable PDF and can save it. means It is editable form.
I used UIWebView to show the PDF, It showing exactly as it is, but the text field on it is un-editable.
I tried using the UIDocumentInteractionControllerto view the pdf, It showing well, but I can't edit on that file.
In safari browser of mac It supports only viewing the file, but Google Chrome supports editing of the file. and While opening the file using Preview application on mac, It allows edition to the user and can save it.
Please suggest me, How to edit and save the file in this..
Thank you...
I was after the same thing and found this to be a seemingly good solution: https://github.com/derekblair/ILPDFKit
Lets you fill in a form, access/set fields and then save out as a static copy.

PDF generation in XCode

I am a newbie in iPhone development. I am planning to do a PDF application for iPhone. The functionality is:
User will type their input in a text field (which is going to be the content of the PDF file).
I have to modify the PDF file through code while saving (paragraphs, tables, bullets etc).
User can save it in their own name.
User can send the PDF file as attachment of MFMailComposer.
So I have searched and got many links. However I didn't find any leading details to create and modify a PDF file in iPhone/iPad.
Can anyone please provide me a good reference to do this. Are there any alternatives to do this?
I've used this reference: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
It contains theoretical explanations and source code examples
Please use the below link to download sample apps for PDF Reader/Viewer in iOS
PDF Reader/Viewer in iOS
Also please look at detail about pdf creation, manipulation etc in below links
developer.apple: PDF Document Creation, Viewing, and Transforming
Fast-and-lean-pdf-viewer-for-iphone
If you were doing a Phonegap app I'd say got for jsPDF, which would enable you to create (basic) PDF files in Javascript. I don't do Obj-C, but a quick look on SO provides good links.

Resources