Add appendix pdf after every page of letter pdf

Post Reply
User avatar
JimmyHartington
Advanced member
Posts: 280
Joined: Tue Mar 22, 2011 7:38 am

Add appendix pdf after every page of letter pdf

Post by JimmyHartington »

I have a flow, where I need to insert an appendix pdf after every page of a letter pdf.

The number of pages in the appendix pdf is not the same for each run.
The number of recipients in the letter pdf is also variable.

My solution now is to split the letter pdf. Using the command line tool PDFTK I insert the appendix pdf. The job is then assembled and merge to a new pdf-file.

This works but can be very slow, if there are many recipients.

So I was curious if any one had a good tool for this?
User avatar
JimmyHartington
Advanced member
Posts: 280
Joined: Tue Mar 22, 2011 7:38 am

Re: Add appendix pdf after every page of letter pdf

Post by JimmyHartington »

So I found a solution based on a Acrobat javascript.

Now I use the Acrobat configurator.

This is the script.

Code: Select all

/* Add blank page for script to work */
$doc.newPage(0, 100, 100);

/* add page after each nth page */
var n = 1;
for (var i=$doc.numPages-1; i>0; i--) {
    if ((i+1) % n == 0) {
        $doc.insertPages(i, "/path/to/appendix/pdf-file/" + $arg1);
    }
}

/* Delete first page */
$doc.deletePages({nStart: 0, nEnd: 0});
Arguement 1 is the name of the appendix-file.

It is faster than my previous solution, but still not as fast as I would like.
What I would like was some kind of commandline utility.
3f8h.net
Member
Posts: 26
Joined: Tue Mar 13, 2012 4:14 pm

Re: Add appendix pdf after every page of letter pdf

Post by 3f8h.net »

We can do this using callas pdfToolbox CLI.
--
Sebastian Nafroth +++ 3f8h.net / electronic publishing

3f8h.net offers professional services and products for the graphic arts
industry.

contact details: http://www.3f8h.net/kontakt
User avatar
JimmyHartington
Advanced member
Posts: 280
Joined: Tue Mar 22, 2011 7:38 am

Re: Add appendix pdf after every page of letter pdf

Post by JimmyHartington »

How is it done with pdfToolbox CLI?
Arthur
Member
Posts: 113
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: Add appendix pdf after every page of letter pdf

Post by Arthur »

Quite Imposing - insert pages ('from file' at interval).
Done.
User avatar
JimmyHartington
Advanced member
Posts: 280
Joined: Tue Mar 22, 2011 7:38 am

Re: Add appendix pdf after every page of letter pdf

Post by JimmyHartington »

@Arthur
Thanks. But I do not have Quite Imposing for my server.
It needs to be done automatic.
Arthur
Member
Posts: 113
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: Add appendix pdf after every page of letter pdf

Post by Arthur »

Well - it can be automated with Quite Hot Folders. But I presume you do not have that one either....
We've been using Quite for years and it was a natural choice to keep things that way when we implemented Switch. But I understand not everyone has got it, in favour of other tools.
Yet - this seemed the most straightforward solution to me....
3f8h.net
Member
Posts: 26
Joined: Tue Mar 13, 2012 4:14 pm

Re: Add appendix pdf after every page of letter pdf

Post by 3f8h.net »

Do you have pdfToolbox CLI installed and licensed?
--
Sebastian Nafroth +++ 3f8h.net / electronic publishing

3f8h.net offers professional services and products for the graphic arts
industry.

contact details: http://www.3f8h.net/kontakt
User avatar
JimmyHartington
Advanced member
Posts: 280
Joined: Tue Mar 22, 2011 7:38 am

Re: Add appendix pdf after every page of letter pdf

Post by JimmyHartington »

@3f8h.net: No. I do not have a license for pdfToolbox CLI.
Post Reply