4

I've been searching for a way to prevent the download of a PDF and I finally found one in HTML5. The code is really simple and is

<embed src="filename.pdf#toolbar=0&navpanes=0&scrollbar=0" width="500" height="375">

The things that suppress the adobe options is #toolbar=0&navpanes=0&scrollbar=0.

My question is, is there a way to do this in non-html5 code? I've tried the following:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    width="99%" height="99%" id="pdf" style="position:absolute; z-index:-1;">
    <param name="movie" value="filename.pdf#toolbar=0&navpanes=0&scrollbar=0">
    <param name="quality" value="high">
    <param name="wmode" value="opaque" /> 
    <param name="Enabled" value="1" />
    <param name="toolbar" value="0" />
    <param name="navpanes" value="0" />
    <param name="scrollbar" value="0" />
    <param name="bgcolor" value="##FFFFFF">
    <embed  nav src="filename.pdf#toolbar=0&navpanes=0&scrollbar=0" quality="high" bgcolor="##FFFFFF" width="99%" height="99%"
            name="2003map" align="" type="pdf">
    </embed>
</object>
Devin Dixon
  • 9,088
  • 20
  • 70
  • 136
  • Are you interested in surpressing the options or preventing the download? What is stopping people from viewing the source and going directly to your pdf? – Trevor Boyle Mar 10 '11 at 19:44

2 Answers2

0

I am not 100% but try adding the values also into the <embed>

<embed  nav src="filename.pdf" quality="high" bgcolor="##FFFFFF" width="99%" height="99%"
            name="2003map" align="" type="pdf"    
toolbar="0" navpanes="0" scrollbar="0"
    </embed>

This doubling of info works for wmode so may very well work here too :)

Kyle
  • 60,843
  • 27
  • 138
  • 150
0

as your users are using a client side engine to render the PDF document there is no way to stop them downloading or saving it. at some point or way the document arrives at the client machine. in case of html it's always easy to have all resources you serve to be saved.

you have to render it on the server if you don't what your pdf as pdf in any case on your client's machine.

you can use an obfuscated flash in combination with Flash Pdf viewer just like scribd and have the pdf's path hidden but this is not 100% secure, because the resource remains accessible, but you can return it as binary from a server side after your viewer swf has identified itself.

Community
  • 1
  • 1
encoder
  • 26
  • 1