Append external PDF to the Main PDF from the (PTK)

Posted by: Stephen O'Leary

Append external PDF to the Main PDF from the (PTK) - 07/29/21 01:17 PM

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
Posted by: MartenM

Re: Append external PDF to the Main PDF from the (PTK) - 07/30/21 02:44 AM

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
Posted by: Stephen O'Leary

Re: Append external PDF to the Main PDF from the (PTK) - 07/30/21 12:47 PM

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
Posted by: Philippe F.

Re: Append external PDF to the Main PDF from the (PTK) - 07/31/21 08:54 AM

The code Marten posted requires the AlambicEdit API that's only available in PlanetPress Ofice/Production.