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

New Here ,
Apr 25, 2019 Apr 25, 2019

Copy link to clipboard

Copied

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!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

115

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

OK, in that case it is better to do it in Acrobat.

I've developed a (paid-for) tool that does just that, actually: Custom-made Adobe Scripts: Acrobat -- Batch Watermark A PDF File

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines