如何在iText生成的PDF上添加单击弹出窗口?

时间:2021-01-24 07:14:07

Basically, I want a built in pop-up window to appear in the PDF document when clicking on a certain Chunk element.

基本上,我希望在单击某个Chunk元素时,PDF文档中会出现一个内置的弹出窗口。

Apparently this is possible, but I have had a bad luck of finding a solution for it. Help is much appreciated!

显然这是可能的,但我找到一个解决方案运气不好。非常感谢帮助!

1 个解决方案

#1


0  

You need the setAction() method and define an action. I know this is only half an answer, but then again, you've posted only half a question. To answer the second half of your question, we'd need to know what type of pop-up you want. Do you want an actual Pop-Up annotation (as described in Chapter 7 of "iText in Action - Second Edition") or is a JavaScript alert sufficient? What is the purpose of the "popup window"? Note that the PDF and AcroJS references talk about concepts such as popup annotations, alert-boxes, etc..., but the concept of a "popup window" isn't defined. You'll need to be more specific using PDF or AcroJS terminology.

您需要setAction()方法并定义操作。我知道这只是答案的一半,但话说回来,你只发了半个问题。要回答问题的后半部分,我们需要知道您想要什么类型的弹出窗口。你想要一个实际的弹出式注释(如“动作中的iText - 第二版”的第7章所述)或者是一个足够的JavaScript提醒吗? “弹出窗口”的目的是什么?请注意,PDF和AcroJS参考文献讨论了弹出注释,警报框等概念,但未定义“弹出窗口”的概念。您需要使用PDF或AcroJS术语更具体。

#1


0  

You need the setAction() method and define an action. I know this is only half an answer, but then again, you've posted only half a question. To answer the second half of your question, we'd need to know what type of pop-up you want. Do you want an actual Pop-Up annotation (as described in Chapter 7 of "iText in Action - Second Edition") or is a JavaScript alert sufficient? What is the purpose of the "popup window"? Note that the PDF and AcroJS references talk about concepts such as popup annotations, alert-boxes, etc..., but the concept of a "popup window" isn't defined. You'll need to be more specific using PDF or AcroJS terminology.

您需要setAction()方法并定义操作。我知道这只是答案的一半,但话说回来,你只发了半个问题。要回答问题的后半部分,我们需要知道您想要什么类型的弹出窗口。你想要一个实际的弹出式注释(如“动作中的iText - 第二版”的第7章所述)或者是一个足够的JavaScript提醒吗? “弹出窗口”的目的是什么?请注意,PDF和AcroJS参考文献讨论了弹出注释,警报框等概念,但未定义“弹出窗口”的概念。您需要使用PDF或AcroJS术语更具体。