【问题标题】:Writing a script that will calculate the total number of text boxes in a pdf that countain a specific text编写一个脚本来计算 pdf 中包含特定文本的文本框总数
【发布时间】:2021-03-23 05:17:59
【问题描述】:

我正在创建一个月度数据收集表,每天工作人员都会从定义的可能值列表中输入一封信。在这种情况下,它们是大写字母“I”“V”“P”“F”和“R”。在 pdf 的底部,我想要一个框来计算输入某个字母的天数。例如,如果当月 31 天中有 10 天输入“I”,我希望它自动计算总和。

Screenshot

【问题讨论】:

    标签: javascript pdf adobe


    【解决方案1】:

    例如,我使用下面的脚本来计算输入“V”的框数。

    var total = 0;
    for(var i=1; i<=31; i++) {
        if(this.getField("B"+i).valueAsString=="V") total++;
    }
    event.value = total;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多