-1

Can I edit the preferences of Adobe Reader using Java/JavaScript. I want to disable the option of reading the PDF files in Browser at some times and at times I should be able to enable the option through programatically.

Kara
  • 6,115
  • 16
  • 50
  • 57
Kali
  • 73
  • 1
  • 2
  • 10
  • What's the target browser? Firefox, I.E., Chrome...? – Aubin Mar 04 '13 at 06:59
  • Google Chrome browser – Kali Mar 04 '13 at 07:02
  • You mean, you ve got an PDF file on your local PC and you want to set a kind of attribute to that file, so that it won't be opened in a browser? Or even can't be opened in a browser? – Xenobiologist Mar 04 '13 at 07:00
  • No. www.aisb.org.uk/convention/aisb08/AISB08.pdf If I click on this url by disabling the option "Display in read mode" in Abode reader it was downloading the PDF file with out asking me to save.If I enable the option in Adobe Reader it was asking me to save the file.With out manual effort is there way I can enable the option and disable the option using Java/JavaScript – Kali Mar 04 '13 at 07:06

1 Answers1

1

You should not be able to escape the browser, that would be a security hole. See the various recent Java vulnerabilities for that.

What you can do is send a different Content-Type header in your HTTP response:

  • application/pdf tells the browser it's a PDF, and the browser can act on that to display it directly
  • octet/binary-stream tells the browser it's nothing in particular, in which case it shouldn't display it but only offer the user to save it on disk
Frank Pavageau
  • 11,477
  • 1
  • 43
  • 53
  • The issue I've run across is that I'd like to add the Adobe parameters, such as "#zoom=120", but the Chrome viewer ignores those. (as of version 38.0.2.2125.111 m) Is there a header such as "application/adobe/pdf" that might force the issue? – UncaAlby Nov 06 '14 at 00:23