skip to Main Content

I have a 14 page pdf document with a header that contains various fields that repeat on each page. I want to have the second, third, fourth, and so on pages to auto populate the header information the same as the info inputted on the first page. I am not familiar with this stuff at all and have gotten as far as I have with only this communities help.

I am using the following script…

var selected = this.getField("Project Number");

Have also tried…

var selectedTask = this.getField ("Project Number");

as well as numerous other variations. Simply put, I want to have the end user fill in the Project Number (and various other items) in the first field and have the same number automatically populate throughout the remainder of the document.

I have also attempted to name the fields the same and copy and paste them to have them all be completed at once. This approach does not work in Bluebeam.

Grateful for your help.

2

Answers


  1. Here is a quick example:

    var projectNumberField = this.getField("Project Number");
    var projectNumberValue = projectNumberField.value;
    
    for (var i = 1; i < this.numPages; i++) {
      var currentPageField = this.getField("Project Number", i);
    
      if (currentPageField) {
        currentPageField.value = projectNumberValue;
      }
    }
    
    Login or Signup to reply.
  2. You attempted one good valid means to your end by copy fields, but you need to be aware why and thus how.
    Here is the BlueBeam Memo sheet which I have 14 pages with a field and can either type into any one field and the other 13 follow suit. OR I can double-click a small text file and all 14 will be auto populated, say from an external application. In either case no JavaScript is required both are an Adobe PDF Acroforms feature.

    enter image description here

    So what did I do different ?

    • I prepared 1 page, added the field and saved it. It is critical the field is perfect or else you will need to start here over again, so check format is for example comb or only numbers, etc.
    • I merged that page to itself, thus 2 cloned pages with fields
    • Repeat twice more now I have 8 pages, so I delete one to only have 7
    • Merge once again , and now I have 14 identical pages with similar fields that have different tags.
    • Run through the field names, and ensure they are without any punctuation, all the same name "ReportNumber" (I prefer CamelCase as easier to understand)
      enter image description here

    So now we have our template and we can simply enter in any one field (as shown above in Acrobat.) It does not need to be the first as all are equal.

    OR you export the Forms Data File with any number like here the export is 123…

    File Template.fdf (any ProjectNumberName will do)

    %FDF-1.4
    %âãÏÓ
    1 0 obj
    <<
    /FDF <<
    /F (Template.pdf)
    /Fields [<<
    /T (ReportNumber)
    /V (123)
    >>]
    /ID [<7BA3DBA72A188B71F4B2A4E34D6D9188> <7BA3DBA72A188B71F4B2A4E34D6D9188>]
    /UF (Template.pdf)
    >>
    /Type /Catalog
    >>
    endobj
    trailer
    <<
    /Root 1 0 R
    >>
    %%EOF
    

    Now if you save that and change the number for arguments sake A-10496-Z
    enter image description here

    Acrobat will open EVERY page with the same data.
    enter image description here

    So any quantity of field that have identical name are treated as only one field. Thus any needing different contents, MUST be different names like Blah1 Blah2 etc.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search