简体   繁体   English

在浏览器中打开PDF禁用嵌入式Javascript

[英]Open a PDF in browser disable the embedded Javascript

I created a wicket page which allow to the user to open PDF files. 我创建了一个小门页面,该页面允许用户打开PDF文件。 These PDF files are forms, which the user fill and send back. 这些PDF文件是用户填写并发送回的表格。 There is also Javascript which is used to automatically fill some fields. 还有一个Javascript用于自动填充某些字段。

The file is correctly open in the browser but there is a problem: Javascript is disabled and I don't know why. 该文件已在浏览器中正确打开,但是存在一个问题:Javascript已禁用,我不知道为什么。 Is it normal? 正常吗 Is it for security reason? 是出于安全原因吗?

When I download the file and open in Acrobat Reader, it works correctly. 当我下载文件并在Acrobat Reader中打开时,它可以正常工作。 I also disabled the option in Acrobat Reader to force the plugin to be used in place of the default reader of the browser. 我还禁用了Acrobat Reader中的选项,以强制使用插件代替浏览器的默认阅读器。 It works only in Firefox. 它仅在Firefox中有效。

Is it possible to activate Javascript? 是否可以激活Javascript? If not, is it possible to open automatically Adobe Reader? 如果没有,是否可以自动打开Adobe Reader? I prefer not to save directly the file if possible. 如果可能的话,我不希望直接保存文件。

If you talk about smartforms, you have to enable JavaScript in Acrobat. 如果谈论智能表单,则必须在Acrobat中启用JavaScript。 It has to be similar in browser or standalone. 它必须在浏览器中相似或独立。 Also there can be many security reasons in different browsers due to enable/disable JS itself. 另外,由于启用/禁用JS本身,在不同的浏览器中可能有许多安全原因。 One of the common reason is XSS voluentabirity. 常见原因之一是XSS的实用性。 Also you have to know if the browser or its plugin supports JS. 您还必须知道浏览器或其插件是否支持JS。 Not all browsers use Acrobat reader as well. 并非所有浏览器也都使用Acrobat Reader。 However see http://www.smartforms.business.gov.au/DeveloperResources/Documents/JavaScript_Instructions.pdf how to enable JS in Acrobat Reader. 但是,请参阅http://www.smartforms.business.gov.au/DeveloperResources/Documents/JavaScript_Instructions.pdf如何在Acrobat Reader中启用JS。

Generaly I do not recommend you to use PDF forms instead of HTML forms. 通常,我不建议您使用PDF表单而不是HTML表单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM