Topic Options
#58118 - 07/29/21 01:17 PM Append external PDF to the Main PDF from the (PTK)
Stephen O'Leary Offline
OL Newbie

Registered: 10/13/20
Posts: 8
Hi All,

I'm generating a letter PDF in Workflow from the imported PTK, but would also like to append a Terms and Conditions PDF file from an external folder.

I'm using the PP Watch version of Workflow. My process imports an XML data file and the rest of the process is outlined as follows.

- PTK

- Send To Folder (Folder c:\ Filename aa.pdf)

- Load External File (External File D:\PlanetPress\Archive\Terms&Conditions\%2.pdf)

- Send To Folder(Folder c:\ Filename aa.pdf also the concatenate files checkbox is checked)

The problem I'm having is the Terms&Conditions aren't getting appended to the bottom of the letter they are instead overwriting the letter file. Is there a way to append these Terms&Conditions in PP Watch without overwriting the letter file?

Stephen

Top
#58119 - 07/30/21 02:44 AM Re: Append external PDF to the Main PDF from the (PTK) [Re: Stephen O'Leary]
MartenM Offline
OL Newbie

Registered: 10/15/20
Posts: 3
Hi Stephen,

For that you can make use of the Merge PDF files plug-in, which can be found in the Inputs tab of the Plug-in Bar, or you can make use of the Run Script plug-in and apply the following VBScript code:

Code:
Dim objPDF, strInputDir, strFilename

Set objPDF = Watch.GetPDFEditObject
strInputDir = "C:/in/" 'Watch.GetVariable("InputDir")
strFilename = "example.pdf" 'Watch.GetVariable("Filename")

objPDF.Open Watch.GetJobFileName, False
objPDF.Pages.InsertFrom strInputDir & strFilename, 0, -1, objPDF.Pages.Count
objPDF.Save False
objPDF.Close

Set objPDF = Nothing


Edited by MartenM (07/30/21 02:49 AM)

Top
#58121 - 07/30/21 12:47 PM Re: Append external PDF to the Main PDF from the (PTK) [Re: Stephen O'Leary]
Stephen O'Leary Offline
OL Newbie

Registered: 10/13/20
Posts: 8
Hi MartenM,

Unfortunately, the Merge PDF files plug-in is only available for Workflows with a Planet Press Production License, I only have access to the Planet Press Watch version.

The code doesn't work either. However, that might be because there is no PDF library installed on my Planet Press Server, but I'm waiting on approval to install it.

Do you have a PDF library installed e.g. Adobe on your Planet Press Machine?

Thanks for your help.
Stephen

Top
#58123 - 07/31/21 08:54 AM Re: Append external PDF to the Main PDF from the (PTK) [Re: Stephen O'Leary]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1970
Loc: Objectif Lune, Montreal, Qc
The code Marten posted requires the AlambicEdit API that's only available in PlanetPress Ofice/Production.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top