使用itextsharp强制在pdf中进行javascript计算 [英] Force javascript calcuation in pdf using itextsharp

查看:167
本文介绍了使用itextsharp强制在pdf中进行javascript计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简化问题。因为我不想混淆。

Simplifying the question. because i don;t want to confuse.

在我的pdf中有3个字段来执行添加操作。

In my pdf there are 3 field to perform add operation.

在两个字段中,我输入一个数字,第三个字段应该显示这两个数字的相加。
为了添加我已经返回java脚本。

In two field I enter a number and third field should show the addition of that two number. To make the addition I have return java script.

现在使用itextsharp我们都知道我们可以设置字段值但是第三个字段没有计算直到我打开pdf并做一些点击和字段选项。

Now using itextsharp we all know we can set the field value but third field is not getting calculated until i open the pdf and do some stuff of click and tab of fields.

我已经阅读了某些地方的itextsharp don; t支持从代码强制计算/执行java脚本。

I have read certain place itextsharp don;t support to make force calculation/execution of java script from code.

任何人都可以告诉我是否添加了任何支持来处理这种情况,或者是否有任何解决方法来强制执行java脚本。

Can any one tell me does any support is added to handle such scenario or is there any work around to force the java script to execute.

或处理此类事情的任何其他方式。

OR any other way to handle such things.

推荐答案

要执行通用的Javascript代码, PDF处理器需要完全模拟Adobe Reader Javascript对象模型。据我所知,周围没有PDF库,特别是没有免费或低价的。

To execute generic Javascript code, a PDF processor would need to completely emulate the Adobe Reader Javascript object model. As far as I know there is no PDF library around that does so, especially no freely available or low prized one.

iText(夏普)特别是不执行任何Javascript由于它操纵PDF。

iText(Sharp) in particular does not execute any Javascript as a result of its manipulating PDFs.

支持Adobe Reader Javascript功能的一部分可能是可行的,这足以支持计算字段。任何PDF库项目肯定会很乐意将这样的东西集成为可选功能。

It might be feasible to support a subset of the Adobe Reader Javascript capabilities which suffices to support calculated fields. Any PDF library project surely would be happy to integrate such a thing as an optional feature.

这篇关于使用itextsharp强制在pdf中进行javascript计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆