How to create a PDF/A document after the user fills out the form in Acrobat? | Community
Skip to main content
nowackem
Level 5
October 7, 2021
Solved

How to create a PDF/A document after the user fills out the form in Acrobat?

  • October 7, 2021
  • 2 replies
  • 1658 views

We would like to script a button for the user to click that utilizes File > Save as Other > Archivable PDF (PDF/A) after they fill out the form in Acrobat.

I would also like to know how to make that command actually work with a dynamic PDF. I get an error when I navigate to that command and try to use it so Im wondering if Archivable PDF option is even available in LiveCycle Designer created forms.

Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kosta_Prokopiu1

@mayank_tiwari on first look it sounded good and I wasn't aware of that option - I learned something about AcroJS...

But for @nowackem this is probably not going to help. Here is why:

  • the command as you show does not work in XFA forms. It would have to be 
    myDoc = event.target;
    myDoc.saveAs("..","..");
  • But even when you use the correct way to address the document it will not work because of the error
    NotAllowedError: Security settings prevent access to this property or method. 

SaveAs is considered a trusted function which can only be executed as part of an external javascript file which must be installed with every user running Acrobat/Reader.

2 replies

Pulkit_Jain_
Adobe Employee
Adobe Employee
October 8, 2021

@nowackem 

I am not sure if this is even possible in Designer created Forms but you can make a webservice call to Forms server for such conversions from Acrobat following this helpdoc. I see that the GeneratePDF service supports direct REST invocation and you may have to tweak the output file format. 

I will wait for the experts to comment on this one, but in case you don't want to use Forms Server then i don't think it's possible OOTB unless user saves the form manually.

Mayank_Tiwari
Adobe Employee
Adobe Employee
October 8, 2021

@nowackem 

Try this: 

this.saveAs("/c/temp/test.pdf","com.callas.preflight.pdfa");

Reference doc: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript/

Kosta_Prokopiu1
Adobe Employee
Kosta_Prokopiu1Adobe EmployeeAccepted solution
Adobe Employee
October 8, 2021

@mayank_tiwari on first look it sounded good and I wasn't aware of that option - I learned something about AcroJS...

But for @nowackem this is probably not going to help. Here is why:

  • the command as you show does not work in XFA forms. It would have to be 
    myDoc = event.target;
    myDoc.saveAs("..","..");
  • But even when you use the correct way to address the document it will not work because of the error
    NotAllowedError: Security settings prevent access to this property or method. 

SaveAs is considered a trusted function which can only be executed as part of an external javascript file which must be installed with every user running Acrobat/Reader.

Mayank_Tiwari
Adobe Employee
Adobe Employee
October 8, 2021

Yes, this is specific to AcroJS only. won't work with XFA forms. For XFA forms, "Convert to PDF/A" service can be used.