Javascript that prints current file to Adobe PDF

New Here ,
Apr 10, 2022 Apr 10, 2022

Copy link to clipboard

Copied

I run a MailMerge add-in (Evermap)  that generates a multiple page document using a PDF form template populated with data from an Excel workbook.  The add-in saves the merged file in a directory I designate ("C:\MyStuff") with a name like  "SAPLabels_Richard Warner_Agro-K R&D_2022CORNIARF601.pdf".  This document consists of multiple pages, one page for each record merged - so 4 records = 4 pages.

Mycomac_0-1649652225868.png

After the MailMerge finishes, I want to execute a javascript that prints the document to Adobe PDF, formatted to print multiple pages per sheet  (2x2), and save it with the same filename, but to a different directory "C:\MyStuff\PDFlabels".  4 pages / sheet.

 

Mycomac_2-1649652296976.png

 

My goal is  to reduce the file size. printing to Adobe PDF from Acrobat accomplishes that, but I'm very open to other approaches that achieve the same outcome.

 

On top of that, I'm unfamiliar with javascript, so any and all advice would be sincerely appreciated.

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript

Views

56

Likes

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
Adobe Community Professional ,
Apr 10, 2022 Apr 10, 2022

Copy link to clipboard

Copied

This is not possible with Acrobat Javascript.

Likes

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
Adobe Community Professional ,
Apr 11, 2022 Apr 11, 2022

Copy link to clipboard

Copied

LATEST

The only way to do that with JS is by creating a Template page with four image fields and then import each page in a loop, saving the file at the end. This is quite tricky to implement, especially if you don't know the number of pages in each file in advance.

Likes

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