Skip to main content
Participant
February 11, 2020
Question

Batch import folder of xmls into pdf form

  • February 11, 2020
  • 1 reply
  • 1729 views

Hi I am trying to build an action or script that allows me to select a folder full of xmls and batch import these files and save them as a pdf using the file name from the xml. Essentially going through Edit->Form Options->Import Data->select the xml->save it and do this for the 50+ xmls in the folder. I would think the pdf form I am trying to fill out would need to be the one open?

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
February 13, 2020

Can you actually import the xmls file directly into the form?

Unfortunately a batch script won't help with this because the batch assumes the file being opened is the document to be operated on. 

 

There a few ways to go with this. 

1) if the XMLS files have a regular naming convention you can write a script to import them.

2) You can write a VB app to perform the batch import and save

3) You can write a plug-ins to perform the batch import and save 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
afontaineAuthor
Participant
February 18, 2020

Yes I am able to import the xmls directly into the form. 

 

You couldnt do a batch even if you open a blank pdf of the file, import the xml and print the file to pdf to flatten it. after that saves import another xml on the same pdf that is open. 

Thom Parker
Community Expert
Community Expert
February 18, 2020

The problem is that a batch assumes each imported file is a PDF, or will become a PDF, because the Batch process is for operation on PDF files. This doesn't work for data. If it did, then people would have using it for mail merge a long time ago. Try it out and see for yourself. 

 

What you really need is a mail-merge process. Look it on this forum and you'll find many posts on the topic. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often