开发者

Can a PDF Embed onmousedown Javascript Events?

开发者 https://www.devze.com 2023-02-06 02:17 出处:网络
My client has some web pages that have A tag links with onmousedown events on them. My tools are PHP, Linux, and the tools for PDF generation there like DomPDF and PHP PDF. Is there a way to put the l

My client has some web pages that have A tag links with onmousedown events on them. My tools are PHP, Linux, and the tools for PDF generation there like DomPDF and PHP PDF. Is there a way to put the links into a PDF with the onmousedown Javascript code still working? The onmousedown events change the href.

I mean, I hear that PDF files can have Javascript in them, but I don't know if that also means the onmousedown event can be included as well and still开发者_StackOverflow中文版 operate.


Current stable releases of dompdf ignore JavaScript when rendering a document. The next release (0.6.0) will include the capability of including JavaScript in the rendered document, but the JavaScript has to be contained inside a script element that is in the body of the document. Because of this requirement you would have to write a function that locates your link and appends onmousedown events.

I don't know enough about using JavaScript in PDF document to say how easy it would be to write a script to do what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消