我想在运行OSX的Acrobat Pro DC中使用Javascript打开pdf文档。这是我所看到的:
app.openDoc("~/Desktop/test.pdf")
Invalid Location "~/Desktop/test.pdf". File or folder does not exist.
NotAllowedError: Security settings prevent access to this property or method.
App.openDoc:1:Console undefined:Exec
undefined我想知道这个错误是否是page 135 of the Javascript for Acrobat reference上提到的安全限制。
发布于 2018-08-25 00:59:35
因为Acrobat JavaScript是跨平台的,你需要使用与设备无关的路径,而不能使用像"~“这样的特定于设备的快捷方式。类似于下面的示例。
Windows Path C:\MyFolder\MyFile.pdf
app.openDoc("/C/MyFolder/MyFile.pdf");Macintosh路径MyDisk:MyFolder:MyFile.pdf
app.openDoc("/MyDisk/MyFolder/MyFile.pdf");您可以使用"../“作为相对路径。
https://stackoverflow.com/questions/52007442
复制相似问题