Skip to main content
boilermaker73
Inspiring
November 29, 2022
Question

Acrobat PDF Form Design Inquiry

  • November 29, 2022
  • 2 replies
  • 4061 views

If done properly using a combination of form fields, scripts, and arrays, is it possible to design an interactive PDF form to collect as well as display the data collected employing the same set of fields on the form or would it normally require two pages or two separate groups of form fields on the same page, namely one group or interface to add|collect the data and another to present it? Moreover, the form fields or interface used to present the data would act as a lookup based on a selection provided by a combo box. I hope this explanation is clear enough to solicit a 'yes' or 'no' answer. In essence, what I would like to do is to create a password manager that isn't contingent on generating a page for each name added to the form. For example, years ago I created a password manager using Acrobat whereby each and every name, vendor, website, etc. added to the form generated an additional page associated with a bookmark. Needless to say, performance suffered as names were added over time especially as the number of pages increased close to 100.  This noted, in creating a new password manager, my idea is to eliminate the need to add pages and generate bookmarks by using arrays to collect, store, and display the data using a 1-2 page PDF form. What are your thoughts if any regarding this subject matter? Thank you ahead of time.

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
November 29, 2022

I've built this type of functionality many times. I save the data in JSON so its easy to handle and can be accessed very quickly.  Using an attachment is a great idea. Except that an attachment cannot be updated from Reader. If you need this to work in Reader, then use a hidden text field to store the data.  

 

You could also build import and export scripts to put the data into CSV format for transfering  to/from Excel.  

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
boilermaker73
Inspiring
December 5, 2022

Thom, I just wanted to thank you for the tidbit regarding JSON in which event  I had since taken some time to read and learn what I could about it. Needless to say, I'm glad I did since on the surface JSON appears to be exactly what I need to create a PDF form able to collect, manage, and view information stored in multidimensional arrays. In reality, while multidimensional arrays work fine for presenting data, I've since run into issues for adding/editing data to the PDF form. As I understand JSON to be a data exchange format similar to a text file. and that I need this to work in Reader as well, am I correct in interpreting your suggestion regarding the hidden text file as a JSON file embeded in the PDF form meaning the file doesn't have to be installed on a server? Also, as I have searched the internet high and low, do you know where I might find an example script or tutorial to show how to use JSON in a PDF form? Thank you ahead of time.

Thom Parker
Community Expert
Community Expert
December 7, 2022

Thom. Thank you for all the feedback. In reference to my initial post , having already spent countless hours trying everything I can think of to collect, store, view, and keep all the data inside one PDF form using a multidimensional array and only two views|pages to essentially lookup, add, and edit password records for different and an unlimited number of names|vendors, I believe I could have easily accomplished this and more if only the addScript and setAction JS methods were supported in Acrobat Reader. Point is, in my particular case I really wanted to be able to add, edit, delete, and view all records in a PDF form using the free Acrobat Reader without having to use and rely on generating additional pages|records using templates. Too bad the methods I previously referred to aren't supported in the Reader. Oh well, wishful thinking at best.   


A technique I've used successfully many times, is to save data to a hidden text field.  You can save a lot of text data to a field.  

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
BarlaeDC
Community Expert
Community Expert
November 29, 2022

yes.

 

 

 

[I was tempted to leave my answer at that]

 

There is no reason why you couldn't do what you want on a single page, I am not sure why one of the tools specifically designed for it would not be a better option. but you could do this in Acrobat.

 

you could have a selection of fields, which when an Add button is clicked updated the records ( more on this later)

Then you could have some kind of search functionality/drop down list to select the option, which then populates those same fields (probably want to add something to add functionality so you don't end up with duplicates.

The only real problem to solve would be how to save the data, but I guess this would work.  CreateDataObject, you could just add/remove entries on a file stored inside the PDF.

(See here for more info - https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf)

 

Just a rough thought, would probably need refinement based onyour expected usage etc....