Skip to main content
Participant
January 27, 2020
Answered

JavaScript help

  • January 27, 2020
  • 1 reply
  • 812 views

I am creating an inventory document for internal company use. How much can JavaScript automate within a document? As an example: An employee selects a number of storage racks by either entering text or selecting from a drop-down option. Based on the answer to that field, the JavaScript code can create a page with a table of field entries (current table desing is 46 rows by 5 columns; of those, 1 row/column for titles; 45 rows and 4 columns have text entry fields in each cell) - basically pasting an entire page that includes the table and a text entry above the table to title the table. Is there a JavaScript coding capable of doing this? If so, any examples? Thanks!

This topic has been closed for replies.
Correct answer Thom Parker

There are a couple of different options here. 

1.  A script inside a document cannot create new pages or content. But it can add new fields to an existing page. And Page Templates provide a way to effectively add new pages. Look up "Page Template"

 

2. If this is for an internal office tool, then you could use a folder level. These scripts have special privileges that allow for creating new pages, fields, and content. As well as many other advanced operations not allowed in form/document scripts. 

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
January 27, 2020

There are a couple of different options here. 

1.  A script inside a document cannot create new pages or content. But it can add new fields to an existing page. And Page Templates provide a way to effectively add new pages. Look up "Page Template"

 

2. If this is for an internal office tool, then you could use a folder level. These scripts have special privileges that allow for creating new pages, fields, and content. As well as many other advanced operations not allowed in form/document scripts. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
ejgreco78Author
Participant
January 27, 2020

Page Template - exactly what I was looking for! And an old JavaScript how-to (https://acrobatusers.com/tutorials/how-to-build-a-button-that-creates-a-new-page/). Thanks!