搜尋此網誌

2017年6月22日 星期四

Acrobat PDF表單製作javascript學習筆記


Acrobat DC SDK Documentation 文件中有欄位屬性及例子(Field properties)

有關PDF Form問題之討論區 官方討論區

Acrobat Library 有很好的javascript教學 & 範例

Creating a referenced text field in a form


Dynamically setting a submit by e-mail address using Acrobat X and XI 在編輯的檔案中click一個button即將此pdf內容attachment至outlook發出,有例子可download


Lets say I have Buttons A and B and text field "Text1" I need code so when I press button A it change fill color of text field to(example green) and when i press button B it change text field to green also but if it is already green(because of button A) then change color to (example red).Can you Guys help pls?
You can use this code:
var field1 = this.getField("Text1");  
if (color.equal(field1.fillColor, color.green)==true) field1.fillColor = color.red;  
else field1.fillColor = color.green; 

判斷A欄位值的不同而後自動填入B欄(自動填入B欄位的值,需判斷A欄位值的不同而不同)
Basically If Field A is ProductA  Field B=10
If Field A is ProductB then Field B =15
If Field A is ProductC then Field B = 20
You can use this code as the custom calculation script for "Field B":
=========
var fieldA = this.getField("Field A").valueAsString;
if (fieldA=="ProductA") event.value = 10;
else if (fieldA=="ProductB") event.value = 15;
else if (fieldA=="ProductC") event.value = 20;
else event.value = "";

檢查必填欄位
var emptyFields = [];
for (var i=0; i     var f= this.getField(this.getNthFieldName(i));
     if (f.type!="button" && f.required ) {
          if (f.valueAsString==f.defaultValue)
               emptyFields.push(f.name);
     }
}
if (emptyFields.length>0) {
     app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));
}



Acrobat官方手冊

2017年6月20日 星期二

Outlook表單不能開啟執行 outlook customer form won't open

2017年6月13日Outlook安全性更新後可能會發生下列問題:

  1. 附件不會打開
  2. iCloud不工作
  3. 自定義表單(customer form)不起作用。(我是遇到這個)

當我開啟outlook自定義表單會出現下列對話框:
「在執行中為了防止危險的代碼,此表單將不會載入中一個或多個物件。
若需詳細資訊,請連絡管理員。」

原因是因為下列windows update所導至,所以如出現和我一樣的狀況,請移除以下的KB即可恢復正常。

Description of the security update for Outlook 2007: June 13, 2017 (KB3191898)
The complete list of KB article for all Office applications is at June 13, 2017, update for Microsoft Office

參考Slipstick網內容https://www.slipstick.com/outlook/updates/outlooks-june-13-2017-security-update/

Custom Forms won’t open

Users are complaining about published custom forms too. VBScript and some controls are blocked.
I have a custom form that's published to my personal forms library that I use for new contacts. When I create a contact, I get the following message and the VBScript behind the form doesn’t run. If I uninstall the security update the problem goes away.
"To help prevent malicious code from running, one or more objects in this form were not loaded. For more information, contact your administrator."