1 person found this helpful
Do you have an example file (the ai template file as well as a sample csv with the kind of data you'll expect to have) you can share? Do you have any code written that you want to ask specific questions about or that we can help debug?
It's tough to know where to start when all we have is a brief snapshot.
1 person found this helpful
A great challenge for Illustrator scripting, but hands-down Indesign outperforms with both user options and script extensibility.
It would for example be relatively easy to use ID's data-merge to create the entire CSV-based document with just the user functions, and then a small script could export all the PDFs into separate documents. However, if Illustrator is the preferred method for one reason or another, William can solve it!
Thank you for your responses guys
I don't actually have any code written up, I've had a play with some plugins importing text data from a CSV but that's about it.
The CSV itself is very basic, a single column with the header 'Serial numbers' and below in a list are the numbers '123456', etc. I imagine it would be easier in InDesign, this way you can create the pages within InDesign with the script once the CSV has been imported then just export it manually, as I need it to all be in the same PDF. Would it be possible to create a loop to count the data within the CSV, and then produce the same amount of pages using the master pages as a template? The serial number would need to be inserted into a text box at the bottom of every 2nd page.
Ah, think I may have found the solution - Simple InDesign script to load content from a CSV file and create a page for each record.The contents of each row are jo…
But can't seem to get it working, I think it may be out dated
You use Indesign's built-in Data Merge feature to do all of this, no scripting required. If you need all of them in a single PDF, then you wouldn't need any export scripts to generate individual pages, so you're good to go.
Unfortunately, it seems that Adobe values ID more than AI. The InDesign API is much more robust than the Illustrator API.. =(
There are a few issues regarding using that script in Illustrator..
- csvToJson() function is not native to Illustrator.
- page is not available in the illustrator API
- masterPageItems is a property of page, see above
This script could likely be reworked for Illustrator, but like i said before, we need to know more about the file you're working with and what you expect the output to be. Can you share the template you're working with as well as a file that represents what the file should look like before it's exported?
Yeah I think I was overthinking it, seems to work fine with the Data Merge feature.
Thanks for the help