Skip to main content
Participant
Apr 26, 2019 6:53 AM UTC
Question

How do read a CSV for a list of names then iterate the list to print a new PDF?

I have a original copy of PDF and a list of names in a CSV. And I want to save a new copy the original then put a name from the list as file name of the new PDF, then repeat the procedure for the rest of names. In the end, I would get copies of PDFs with different names.

The first step is to read a CSV. The second step is to save a new file. How can I achieve my goal in javascript in Adobe?

Thank you!

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Legend
Apr 26, 2019 10:30 AM UTC

If I were you, I would not try to scale up the script, but write an app in VB which runs the script on a list of files. Acrobat JavaScript is DESIGNED to make it difficult to work with files, it is a real struggle. Plus Acrobat doesn't scale up well.

Translate
Legend
Apr 26, 2019 8:10 AM UTC

You would be better writing this in Visual Basic, since it is much better suited to controlling the process. You'd use open the master PDF, the VB:JavaScript bridge to fill it. Then print and close without saving; repeat. If you have more than a few dozen you should restart Acrobat regularly in the loop.

Translate
try67
Community Expert
Community Expert
Apr 26, 2019 9:33 AM UTC

Even that is overkill. All you need is a simple file duplication/renaming utility. It doesn't matter this is a PDF file, it could be any file type.

Opening it and then printing or re-saving it is just unnecessary. You just need to duplicate and rename it using the values from the list.

Translate
Participant
Apr 26, 2019 10:25 AM UTC

You are right, but I also want to add a distinct watermark to each copy. I have the script to add watermark for a single name, but do not know how to scale it up to prepare multiple copies in one go.

Translate