I’m not convinced that a conversation over the phone is going to be very helpful when it comes to solving my problem, but I’ll keep it in mind. It’s a lot easier to show things via writing, so I’m going to try this again first, but with a more in dept description of what I have and what I want to achieve.
Below is pretty much what my workflow looks like at the moment.
Merge pdfs : merges the input pdf files, Optimizes the resulting pdf and creates metadata
|
Run Script:
// Open Current Job file as the PDF to modify
var InputPDF = Watch.GetPDFEditObject();
InputPDF.Open(Watch.GetJobFileName(),false);
var metadata = Watch.GetMetadataFileName();
// Open a PDF file containing the page to be added to the inputPDF
var InsertPDF = Watch.GetPDFEditObject();
InsertPDF.Open("C:\PlanetPress\PdfInput\Insert.pdf",false);
// Currently inserts a page after every 10 pages. Needs to be changed to insert a page before each document
for(var pageIndex = 0; InputPDF.Pages().Count() > pageIndex; pageIndex += 10)
{
InputPDF.Pages().InsertFrom2(InsertPDF.Pages(),0,1,pageIndex);
}
InputPDF.Save(false);
InputPDF.Close();
InsertPDF.Close();
|
Send to folder
I mostly wanted to find out how to access the MetaData via the script, to find out where the documents start so I can insert my a pdf there in front of them.
The pdf that is being inserted is currently a pre made pfd file, purely made for testing. I’m planning to generate it with a subprocess later, since I want some information in these pdfs that can only be found during the workflow. They should display the amount of pages in the document after them.