3

I'm currently working on a web application that will be a front-end to an FTP server. The server contains a few thousands of pdf/doc/docx files and every month they add a few more dozens sometimes close to a hundred files.

The current application we have uses openoffice to convert the files to pdf. Than we use pdf2swf to convert the files to swf objects which we display in the browser. In the new application all the data is found in the FTP server and we can't store/create the swf files.

We need to first resolve the url to some resource on the server than download it to a different machine and display the document in the browser.

Is there a way (preferably in python) to generate the swf objects relatively fast to our uses?

A better solution would have been something like google's document viewer api, but unfortunately their TOS doesn't approve such a use: "You may not use the Service to develop a visual document search and preview application which embeds multiple uses of the Google Docs Viewer in a single webpage for DOC, DOCX, or PPTX filetypes."

S. Developer
  • 156
  • 2
  • 6
  • Because the current application is already written in python with a few shell scripts. We're not planning on completely rewriting the application, just the file functionality. But it is just a preference, as long as there is a good solution I don't mind glowing together more than one language. – S. Developer Jan 31 '12 at 09:53

1 Answers1

2
  1. For PDF, you could be interested to use a full javascript implementation done by the Mozilla team: pdf.js. You only need to serve the pdf.js files + the pdf with your python server :)

  2. For doc/docx, you can use openoffice tools to convert them to PDF. Then back to 1. :) (if you still want to write that part yourself, unoconv is written in Python and use Python-UNO bridge)

Community
  • 1
  • 1
tito
  • 12,990
  • 1
  • 55
  • 75
  • Thanks for your replay. I'm already using openoffice with python-uno, and for a lack of a better tool i'll use it in the new system. It's actually not that bad in terms of speed. pdf.js seems great, i'll check it out now. thanks. – S. Developer Jan 31 '12 at 11:43