Stamping XML contents onto PDF

Post Reply
strido
Member
Posts: 34
Joined: Tue Jan 19, 2016 7:02 pm

Stamping XML contents onto PDF

Post by strido »

I'm trying to put some contents of an XML file onto a PDF using Switch and Pitstop Server Variable sets and action lists without much success.

My switch flow inputs zipped file with the xml and (x) number of PDFs inside. As of now I have a folder with all of the PDFs, and a sidecar XML that goes with each. It is my understanding that the Variable Set should be pointed at the XML file and from there we choose the relevant node in the XML <address>xyx</address> or <jobid>1234</jobID> etc. The Variable Definition should be "Job Ticket">"Text"(?) and the Variable Value is a selection to the XPath where the XML lives.

From there, you create an action list, enable variable names, then use a variable from your variable set. Fill out the font and coordinates and from here nothing happens. After I run my flow, it's coming up with 349 / PitStop Library error code 3504 “An error occurred while calculating the values of a required variable.”

Question - in the variable set, I'm choosing an xml that I created earlier in the flow. Could I be using an xml that has since been deleted in subsequent runs? Do I need to somehow create a template XML and just store that in a separate folder that's never deleted?
Malcolm Mackenzie
Member
Posts: 130
Joined: Wed Mar 22, 2017 5:05 pm
Location: London, UK
Contact:

Re: Stamping XML contents onto PDF

Post by Malcolm Mackenzie »

Hi
Not sure what your flow is doing, you can save a grab or document it.

You may need the metadata module and then use
https://www0.enfocus.com/en/appstore/product/xml-pickup
to either
Metadata alongside asset
• Metadata in job folder asset
• Metadata refers to asset
• Metadata is asset
For more info, see Pickup modes in the Switch Reference Guide.
strido
Member
Posts: 34
Joined: Tue Jan 19, 2016 7:02 pm

Re: Stamping XML contents onto PDF

Post by strido »

I thought it easier to break one large workflow into smaller bits. My workflow status so far:

CRS 1 unzips each job, extracts package-level PDF data from instructions.xml and builds a manifest CSV using a Powershell script. (All scripting courtesy of AI)

CRS 2 expands that manifest into one XML package job per package using another Powershell script.

CRS 3 matches each package job to its source PDF, copies the PDF into package input, and creates a sidecar XML containing all package metadatawith (you guessed it) a Powershell script. So that sidecar XML contains the address and jobID and what I need to stamp onto the PDF.

CRS 4 reads the matching sidecar XML for each PDF and loads all values into Switch private data, confirming the contents are ok. This is using a script from Switch Scripter Module.

If I change my Action list to stamp just static text - "Hello, World" or whatever, it works. It's only when I try to use the variables where I run into trouble.
Post Reply