2014-11-18 2 views
0

사용자 입력 메시지가 여러 입력 된 작업 사용자 지정 동적 스탬프가 있습니다. 지금 내가하려고하는 것은 어떻게 든 실제로 렌더링 된 후 양식 텍스트 필드를 스탬프에 가져 오는 것입니다. 예를 들어, 누군가가 처음에 원장 코드를 제외한 모든 것에 우표를 넣었을 때 (그 당시를 모르기 때문에) 원장 코드를 알고있는 사람에게 PDF를 보냈다면 그 장부에 대한 능력을 갖고 싶습니다 코드가 편집 가능한 양식 필드 였고 추가 스탬프를 사용할 필요가없는 것처럼 추가되었습니다. 스탬프는 "스탬프"후사용자 지정 동적 스탬프 스탬프 후 양식 필드 편집 허용

그래서 정말, 정말 여기

(... 내 생각) 내가 지금 양식을되고 싶어 ... 그것은 더 이상 스탬프를 수 있습니다 싶지 않아 스탬프 일단 스탬프의 작업 코드 (마이너스 "승인"필드)

var dialog = { 
    VendorNum: "", 
    Date: "", 
    ProjNumRow1: "", 
    ProjNumRow2: "", 
    ProjNumRow3: "", 
    ProjNumRow4: "", 
    GLCodeRow1: "", 
    GLCodeRow2: "", 
    GLCodeRow3: "", 
    GLCodeRow4: "", 
    AmountRow1: "", 
    AmountRow2: "", 
    AmountRow3: "", 
    AmountRow4: "", 
    Approval: "", 

    commit:function (dialog) { // called when OK pressed 
     var results = dialog.store(); 
     this.VendorNum = results["txt1"]; 
     this.Date = results["txt2"]; 
     this.ProjNumRow1 = results["txt3"]; 
     this.ProjNumRow2 = results["txt4"]; 
     this.ProjNumRow3 = results["txt5"]; 
     this.ProjNumRow4 = results["txt6"]; 
     this.GLCodeRow1 = results["txt7"]; 
     this.GLCodeRow2 = results["txt8"]; 
     this.GLCodeRow3 = results["txt9"]; 
     this.GLCodeRow4 = results["txtA"]; 
     this.AmountRow1 = results["txtB"]; 
     this.AmountRow2 = results["txtC"]; 
     this.AmountRow3 = results["txtD"]; 
     this.AmountRow4 = results["txtE"]; 
     this.Approval = results["Approval"]; 
    },  

    description: 
    {  
     name: "Accounts Payable", // Dialog box title 
     width: 400, 
     height: 400, 
     elements: 
     [ 
      { 
       type: "view", 
       align_children: "align_left", 
       elements: 
       [ 
        { 
         name: "TopGapPlaceholder", 
         type: "gap", 
         height: 20, 
        }, 
       ] 
      }, 
      { 
       type: "view", 
       alignment: "align_center", 
       elements: 
       [ 
        {  
         name: "ACCOUNTS PAYABLE", 
         type: "static_text", 
         alignment: "align_center", 
         width: 120, 
        },         
       ] 
      }, 
      { 
       type: "view", 
       align_children: "align_left", 
       elements: 
       [ 
        { 
         name: "TopGapPlaceholder", 
         type: "gap", 
         height: 20, 
        }, 
       ] 
      }, 
      { 
       type: "cluster", 
       elements: 
       [ 
        { 
         type: "view", 
         width: 70, 
         elements: 
         [ 
          { 
           type: "view", 
           align_children: "align_row", 
           elements: 
           [ 
            {  
             name: "Vendor #: ", 
             type: "static_text", 
             alignment: "align_right", 
             width: 80, 
            },  
            {  
             item_id: "txt1", 
             type: "edit_text", 

             multiline: false, 
             width: 100, 
             height: 20 
            },         
           ]        
          }, 
          { 
           type: "view", 
           align_children: "align_row", 
           elements: 
           [ 
            {  
             name: "Date: ", 
             type: "static_text", 
             alignment: "align_right", 
             width: 80, 
            },  
            {  
             item_id: "txt2", 
             type: "edit_text", 
             multiline: false, 
             width: 100, 
             height: 20 
            }, 
           ] 
          } 
         ] 
        } 
       ] 
      }, 
      { 
       type: "view", 
       align_children: "align_left", 
       elements: 
       [ 
        { 
         name: "AboveProjectsGapPlaceholder", 
         type: "gap", 
         height: 30, 
        }, 
       ] 
      }, 
      { 
       type: "view", 
       align_children: "align_row",     
       elements: 
       [ 
        { 
         type: "view", 
         elements: 
         [ 
          { 
           type: "view", 
           align_children: "align_left", 
           elements: 
           [ 
            { 
             name: "RowGapPlaceholder", 
             type: "gap", 
             height: 20, 
            }, 
            {  
             name: "Row 1: ", 
             type: "static_text", 
             height: 20, 
            }, 
            {  
             name: "Row 2: ", 
             type: "static_text", 
             height: 20, 
            }, 
            {  
             name: "Row 3: ", 
             type: "static_text", 
             height: 20, 
            }, 
            {  
             name: "Row 4: ", 
             type: "static_text", 
             height: 20, 
            },         
           ]        
          }, 
         ] 
        },     
        {      
         type: "cluster",       
         elements: 
         [ 
          { 
           type: "view", 
           align_children: "align_center", 
           elements: 
           [ 
            {  
             name: "Project #", 
             type: "static_text", 
            }, 
           ] 
          }, 
          { 
           type: "view", 
           align_children: "align_left", 
           elements: 
           [      
            // PROJECT NUMBERS COLUMN 
            {  
              item_id: "txt3", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txt4", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txt5", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
            {  
              item_id: "txt6", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
           ] 
          } 
         ] 
        }, 
        { 
         type: "cluster",       
         elements: 
         [ 
          { 
           type: "view", 
           align_children: "align_center", 
           elements: 
           [ 
            {  
             name: "General Ledger Code", 
             type: "static_text", 
            }, 
           ] 
          }, 
          { 
           type: "view", 
           align_children: "align_left", 
           elements: 
           [      
            // GL CODES COLUMN           
            {  
              item_id: "txt7", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txt8", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txt9", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
            {  
              item_id: "txtA", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
           ] 
          } 
         ] 
        }, 
        { 
         type: "cluster",       
         elements: 
         [ 
          { 
           type: "view", 
           align_children: "align_center", 
           elements: 
           [ 
            {  
             name: "Amount", 
             type: "static_text", 
            }, 
           ] 
          }, 
          { 
           type: "view", 
           align_children: "align_left", 
           elements: 
           [      
            // AMOUNT COLUMN 
            {  
              item_id: "txtB", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txtC", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            },  
            {  
              item_id: "txtD", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
            {  
              item_id: "txtE", 
              type: "edit_text", 
              //alignment: "align_row", 
              multiline: false, 
              width: 100, 
              height: 20 
            }, 
           ] 
          } 
         ] 
        }, 
       ] 
      }, 
      { 
       type: "view", 
       align_children: "align_left", 
       elements: 
       [ 
        { 
         name: "ButtonGapPlaceholder", 
         type: "gap", 
         height: 50, 
        }, 
       ] 
      }, 
      { 
       type: "cluster", 
       align_children: "align_right", 
       elements: 
       [ 
        { 
         type: "view", 
         align_children: "align_row", 
         elements: 
         [ 
          // BUTTON GROUP 
          {  
            type: "ok_cancel", 
            ok_name: "Ok", 
            cancel_name: "Cancel" 
          },  
         ] 
        } 
       ] 
      } 
     ]   
    }  
}; 

if(event.source && event.source.forReal && (event.source.stampName == "#8ykdtJ56pcQrQ7Sxn1-99A")) 
{ 
    if ("ok" == app.execDialog(dialog)) 
    { 
    console.println(dialog.VendorNum); 
    console.println(dialog.Date); 
    console.println(dialog.ProjNumRow1); 
    console.println(dialog.ProjNumRow2); 
    console.println(dialog.ProjNumRow3); 
    console.println(dialog.ProjNumRow4); 
    console.println(dialog.GLCodeRow1); 
    console.println(dialog.GLCodeRow2); 
    console.println(dialog.GLCodeRow3); 
    console.println(dialog.GLCodeRow4); 
    console.println(dialog.AmountRow1); 
    console.println(dialog.AmountRow2); 
    console.println(dialog.AmountRow3); 
    console.println(dialog.AmountRow4); 
    if (!dialog.VendorNum) { 
     this.getField("VendorNum").value = ""; 
    } else { 
     this.getField("VendorNum").value = dialog.VendorNum; 
    } 
    if (!dialog.Date) { 
     this.getField("Date").value = ""; 
    } else { 
     this.getField("Date").value = dialog.Date; 
    } 
    if (!dialog.ProjNumRow1) { 
     this.getField("ProjNumRow1").value = ""; 
    } else { 
     this.getField("ProjNumRow1").value = dialog.ProjNumRow1; 
    } 
    if (!dialog.ProjNumRow2) { 
     this.getField("ProjNumRow2").value = ""; 
    } else { 
     this.getField("ProjNumRow2").value = dialog.ProjNumRow2; 
    } 
    if (!dialog.ProjNumRow3) { 
     this.getField("ProjNumRow3").value = ""; 
    } else { 
     this.getField("ProjNumRow3").value = dialog.ProjNumRow3; 
    } 
    if (!dialog.ProjNumRow4) { 
     this.getField("ProjNumRow4").value = ""; 
    } else { 
     this.getField("ProjNumRow4").value = dialog.ProjNumRow4; 
    } 
    if (!dialog.GLCodeRow1) { 
     this.getField("GLCodeRow1").value = ""; 
    } else { 
     this.getField("GLCodeRow1").value = dialog.GLCodeRow1; 
    } 
    if (!dialog.GLCodeRow2) { 
     this.getField("GLCodeRow2").value = ""; 
    } else { 
     this.getField("GLCodeRow2").value = dialog.GLCodeRow2; 
    } 
    if (!dialog.GLCodeRow3) { 
     this.getField("GLCodeRow3").value = ""; 
    } else { 
     this.getField("GLCodeRow3").value = dialog.GLCodeRow3; 
    } 
    if (!dialog.GLCodeRow4) { 
     this.getField("GLCodeRow4").value = ""; 
    } else { 
     this.getField("GLCodeRow4").value = dialog.GLCodeRow4; 
    } 
    if (!dialog.AmountRow1) { 
     this.getField("AmountRow1").value = ""; 
    } else { 
     this.getField("AmountRow1").value = dialog.AmountRow1; 
    } 
    if (!dialog.AmountRow2) { 
     this.getField("AmountRow2").value = ""; 
    } else { 
     this.getField("AmountRow2").value = dialog.AmountRow2; 
    } 
    if (!dialog.AmountRow3) { 
     this.getField("AmountRow3").value = ""; 
    } else { 
     this.getField("AmountRow3").value = dialog.AmountRow3; 
    } 
    if (!dialog.AmountRow4) { 
     this.getField("AmountRow4").value = ""; 
    } else { 
     this.getField("AmountRow4").value = dialog.AmountRow4; 
    } 
    if (!dialog.Approval) { 
     this.getField("Approval").value = ""; 
    } else { 
     this.getField("Approval").value = dialog.Approval; 
    }  
    } 
} 

답변

1

은, 그것은 더 이상 (이 페이지에 주위를 이동할 수있을 수 있지만,이 약 전부 수정할 수 없습니다 찍혀).

"우표를 양식으로 바꾸고 싶다면"바로 양식으로 시작해야합니다. 다시 말해, 사용자가 문서에서 작성할 수있는 양식 필드를 배치하는 것이 어떻습니까?

필드를 추가하려면 addField() 메서드를 사용합니다.

Reader에서 문서를 지원해야하는 경우 Reader XI 이상을 사용하거나 확장 권한을 추가해야합니다.

+0

처음에는 Reader를 사용하는 것이 좋을 것이라고 말하고 싶습니다 ... 왜 버전이 XI 이상입니까? 나는 솔직히 말해서 Acrobat에 익숙하지 않은 분입니다. XI +는 양식 필드를 편집 할 수 있습니까? 이 시점에서 우표가 적용된 후 기본적으로 평평한 이미지로 변하는 것을 볼 수 있습니다. 그럼, 아마도 올바른 방향으로 몇 가지 점잖은 문서/말 예를 가리킬 수 있습니까? 일부 텍스트 필드 (또는 이미 만든 전체 양식)를 문서에 배치 할 단추를 Acrobat의 도구 모음에 추가합니까? – JzInqXc9Dg

0

실제로 다시 렌더링 할 동적 스탬프를 얻을 수 있습니다. 자바 스크립트를 사용하여 해당 스탬프에 해당하는 주석 객체를 가져 와서 속성 객체를 가져와 APCosObj 속성을 삭제 한 다음 속성을 수정 된 속성 객체로 설정하면됩니다. Acrobat에 사용자 정의 스탬프가 설치되어있는 동안에는 대화 상자가 나타나서 사용자가 데이터를 입력 할 수 있습니다. 불행히도 스탬프의 기존 데이터에 직접 액세스 할 수 없으므로 스탬프를 저장하는 메커니즘을 제공해야합니다. 모든 주석은 작성시 고유 한 "이름"등록 정보를 가지므로 이름을 사용하여 저장된 데이터를 주석에 연결할 수 있습니다.

첫 페이지의 첫 번째 우표의 모양이 더 이상 존재하지 않음을 감지하면 코드는 ... 같은

annot = this.getAnnots()[0]; 
props = annot.getProps(); 
delete props.APCosObj; 
annot.setProps(props); 

아크로뱃 (또는 리더)를 보일 수 있습니다 귀하의 주석을 가정 할 기본적으로 스탬프를 다시 작성하고 코드를 다시 실행합니다.