Page 1 of 1
xls variable data
Posted: Tue Mar 03, 2015 1:44 pm
by abonsey
I have a supplied xls file that I want to create variable data PDFs from and I'm looking for guidance on best practice.
My assumptions are:
1. Convert to csv - What's the best method and how's it done?
2. Merging data - into Indesign directly (can this be done) or using something like HP Smartstream Designer to merge the data?
Thanks for any help and advice given
Re: xls variable data
Posted: Tue Mar 03, 2015 3:28 pm
by gabrielp
I believe the Smartstream configurator will only take a csv or txt, even more annoyingly it has to match the name of the template file exactly (or rather the filename prefix had to match).
If I were you, I'd make a little script to convert xls to csv. If you look through NPM, you'll see a bunch of node packages which either do this already or do the xls parsing already. Writing a csv is pretty trivial.
Re: xls variable data
Posted: Tue Mar 03, 2015 4:56 pm
by abonsey
Any other options as I don't have the scripting module?
Re: xls variable data
Posted: Tue Mar 03, 2015 7:07 pm
by gabrielp
abonsey wrote:Any other options as I don't have the scripting module?
Hmm... Do you have access to "execute command"? Perhaps you could use something like curl from CLI through that configurator to invoke
https://developers.zamzar.com or another service that converts those.
Another option might be dropping the xls into Google Drive and then somehow building a link that will export a csv when you GET:
https://stackoverflow.com/questions/116 ... csv-format
Both seem kind of "out there". Maybe someone has some less crazy ideas

Re: xls variable data
Posted: Thu Mar 05, 2015 6:46 pm
by abonsey
gabrielp wrote:I believe the Smartstream configurator will only take a csv or txt, even more annoyingly it has to match the name of the template file exactly (or rather the filename prefix had to match).
If I were you, I'd make a little script to convert xls to csv. If you look through NPM, you'll see a bunch of node packages which either do this already or do the xls parsing already. Writing a csv is pretty trivial.
I have a trial of the scripting module installed. I've never done anything like this before. Can you give me some guidance or step-by-step?
Hopefully somebody can

Re: xls variable data
Posted: Mon Mar 09, 2015 2:43 pm
by gabrielp
Honestly, I'd look at using a conversion service. There are Javascript libraries made to deal with xls files but you can't include external JS files in Switch Scripter so it would be tough.
So if you were going to use something like Zamzar, you'd need a curl script to do the following:
Code: Select all
curl https://api.zamzar.com/v1/jobs \
-u GiVUYsF4A8ssq93FR48H: -X POST \
-d "@my_file.xls" -d "target_format=csv"
When I use cURL, I usually build a bash script, save it to a file, then have Switch execute the file and remove it when done. Here are two examples of exactly that:
But, that was before the HTTP class was available in Scripter. So now you could just use that (possibly even the HTTP configurator) to POST to the Zamzar API.