8

I would love to use google document viewer, but I am dealing with sensitive documents and google's Terms state that if you use their service the document basically becomes public domain.

Are they any alternatives that will keep your content private?

Also it would be best if there was the ability to disable printing and downloading.

FYI: I am developing with ruby on rails, it would be cool if there was a gem.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Jonathan
  • 16,077
  • 12
  • 67
  • 106
  • If `pdf->html` conversion is what you want: have a look at this stackoverflow thread: http://stackoverflow.com/questions/1900423/what-is-a-good-pdf-to-html-converter-for-ruby-on-rails – ChristopheD May 12 '10 at 21:19
  • Is using a local Acrobat Reader instance out of the question? – Pekka May 12 '10 at 21:19
  • Is there a way to embed Acrobat Reader and disable printing and downloading? – Jonathan May 13 '10 at 17:30
  • you can diable printing by using the acrobat security. You can prevent downloads by moving the pdf's out of the webroot and using your script to stream them to the browser if needed. – Geek Num 88 Jun 03 '10 at 00:12

3 Answers3

5

PDF is a page format and it doesn't convert to HTML that nicely. If you want to preserve the look of the PDF file 100%, convert to an image. You can convert to a lower res image to dissuade users to print your pdf. Also, you can put a watermark on the image with "CONFIDENTIAL" or "DO NOT COPY" with imagemagick: http://www.imagemagick.org/script/composite.php

Use ghostscript to convert your PDF to an image:

gs -q -dNOPAUSE -dBATCH -sDEVICE=pngalpha -r300 -dEPSCrop -sOutputFile=$FILE.png $FILE.pdf

Or ImageMagick:

convert -density 300 $FILE.pdf $FILE.png

Source: http://hublog.hubmed.org/archives/001875.html

Costi
  • 1,231
  • 2
  • 11
  • 18
2

Found a great solution with FlexPaper http://flexpaper.devaldi.com/

Doesn't support all document types, only pdfs for now, but that does the trick for me

Jonathan
  • 16,077
  • 12
  • 67
  • 106
-1

You might want to check this gem 'prawn'. It's a PDF generator for Ruby:

https://github.com/prawnpdf/prawn/wiki

RamC
  • 1,287
  • 1
  • 11
  • 15
sameera207
  • 16,547
  • 19
  • 87
  • 152
  • thanks, but I am looking for a way to securely embed a pdf document on a webpage, not generate pdfs – Jonathan May 13 '10 at 11:21