Copy link to clipboard
Copied
I am working on project were we will be generating a fillable PDF questionnaire that will be populated with data from our servers, the remaining missing information will need to be completed by the end user; however, we would like to be able to track what fields the end user is changing or inputting new information. Is there a way to allow us to track any changes that are made after the PDF is generated with the partially completed data?
We are flexible with regards to how we display the changes. Open to suggestions.
I was thinking of having a document level Javascript that we can turn on once the PDF is generated, via a button, that would change the text colour to red or green while keeping the existing text black, unless it is overridden.
One easy way is to have your server app also populate the "Default" value of each field. That way a script simply compares the current value to the default to determine a difference. And that script could also highlight the changed fields with a color change.
var strFieldName = ...
var oFld = this.getField(strFieldName);
if(oFld.value != oFld.defaultValue)
oFld.fillColor = color.red;
Copy link to clipboard
Copied
One easy way is to have your server app also populate the "Default" value of each field. That way a script simply compares the current value to the default to determine a difference. And that script could also highlight the changed fields with a color change.
var strFieldName = ...
var oFld = this.getField(strFieldName);
if(oFld.value != oFld.defaultValue)
oFld.fillColor = color.red;
Copy link to clipboard
Copied
Was speaking with my developers and they don't seem to be able to populate the value as "default". Any chance that you can provide some insight on how we can set the value as default in the PDF generator. We are using Poppler to fill the PDF and PDFtk to stitch the document together.
Copy link to clipboard
Copied
The code works perfectly, however, i need to highlight the field to get the color to change to red. Would there be an option to run this script on a document level rather than a field level and have the color change reflect permanently?