【问题标题】:How to make a redirect in the browser using pdf?如何使用pdf在浏览器中进行重定向?
【发布时间】:2017-03-09 23:07:28
【问题描述】:

我想问用户一个问题,如果他们点击yes按钮,那么他们应该被重定向到另一个页面。

Adobe Acrobat 允许我们在 pdf 中插入 JS:

if (app.alert("Do you want to go on page X?", 2, 3) === 4) {
    // Make the direct somehow.
}

我认为我们不能在那里使用location 对象。

【问题讨论】:

  • AcroJS 帮助文件说:转到文档的第一页。这个.pageNum = 0;将文档前进到下一页。 this.pageNum++;

标签: javascript pdf adobe acrobat acrobat-sdk


【解决方案1】:

请尝试

if (app.alert("Do you want to go on page X?", 2, 3) === 4) {
    app.launchURL("http://example.com", true);
}

true 在新的浏览器窗口中打开,默认为false,它将在阅读器中加载它。

【讨论】:

  • 谢谢!我刚刚在浏览器中尝试过,但看起来它不起作用。还有其他想法吗?
猜你喜欢
  • 2013-05-17
  • 2011-06-30
  • 2015-12-30
  • 2022-01-23
  • 1970-01-01
  • 1970-01-01
  • 2019-06-20
  • 2013-07-26
  • 1970-01-01
相关资源
最近更新 更多