Copy link to clipboard
Copied
I want to create labels to put on carboard boxes containing products, the labels have product information om them, text and logos. The data comes from an Excel database.
So I found a software to handle this. Teacup bar code maker & Teacup data linker.
Then comes the next problem. What I want to do is to auto generate let’s say for example 25 labels with the push of a button (once I have set up the template for the label) with data from a database.
Then I want these labels to be exported from Indesign as separate PDF documents, each page/label, named with a prefix and the item code for the specific item, for example “Outer box label 123123” (“Prefix Item code”)
I've been told this can be done with a script, but I have none whatsoever experience in scripting. Does anyone know if a script like this exist or if I can get someone to produce it for me?
Best regards Fredrik
Copy link to clipboard
Copied
If you share an example INDD file with information from which "places" on the page information should be extracted - someone here should be able to help you - either for free or for a fee.
Copy link to clipboard
Copied
OK. So hoefully someone can help me 🙂
Here is the sample file that I have created. (Before I buy the software this is a testfile to see if this works as I want it too so this is made with the trial software.)
I have created the template, and linked information from the database as I want to.
I tested to do an export to separate PDF files and this works as I want it to.
The only thing left now is to be able to export these pages as separate PDF files with the naming I want it to have.
I have attaced the InDesign file. I have also attached an image of the item code I want to be part of the name. It's marked in yellow. The Item code is called "artnr" in the database I use.
I have also attached the sample database.
The software I will use is called Teacup DataLinker
The thing is, that I will create different template files for different types of products so the item number (artnr) will not always be in the same place as in the template attached.
Is it possible to get the script to collect the name from the data base?
I aslo want a prefix specifying what type of label it is. Outer packaging or inner packaging pallet and perhaps something else that I can't think of now, so I need to be able to change the prefix.
So it should be named
"Prefix Item code"
So for example " Outer packaging label 101131-E" or "Inner packaging label 101132-E"
Best regards Fredrik
Copy link to clipboard
Copied
I'm not sure you really need TeaCup for that...
It's simple enough for DataMerge - unless, you need to be able to constantly update / synchornise data...
Copy link to clipboard
Copied
They've "flattened" your XML:
This should look more like in your CSV file - more columns and less rows.
Copy link to clipboard
Copied
If they would've left ParaStyles or CharStyles - it would be much easier:
Copy link to clipboard
Copied
But even without Styles - it's not a big deal for my tool:
I've sorted by POS Y and PAGE INDEX - green rects - to get first TFs on pages sorted together.
Your codes for file names - red rectangle.
Now I just need to prepare extra Tasks to export - but that's piece of cake.
My tool isn't free (everything that can be seen on screenshots is available in the free version) - and PC only (from your file I can see that you work on Windows) - but if you have a lot of this kind of stuff to do...
My tool could even build those tickets for you - so you could have a true one-click-solution - XLS->PDF(s)->upload-to-ftp or whatever.
Copy link to clipboard
Copied
Here is an example of DataMerge solution - built-in free solution - but without export:
And here is an example of final document:
Of course you would've to do something with BarCodes...
Copy link to clipboard
Copied
Attached are both INDD files - DataMerge template and example file.
Database you already have - so just download those files to the same folder as your CSV file.
I've also re-uploaded IDML versions.
You'll get a lot of oversets - just edit ParaStyles - I made texts bigger for the Pages Panel preview.
Copy link to clipboard
Copied
Looking at the price of the TeaCup...
Here is a free solution to export named PDFs:
https://creativepro.com/data-merging-individual-records-separate-pdfs/
I'll also try to find script that takes info from objects on pages - I think someone posted one some time ago.
Copy link to clipboard
Copied
Thank you.
I will check your files tomorrow, its late heter in Sweden now.
But does this solution allow me to create bar codes?
I cant sen to find any solution except teacuo that can handle bar codes.
Copy link to clipboard
Copied
You're welcome.
Yes, the only "problem" is in generating barcodes.
TeaCup isn't the only solution / generator.
Copy link to clipboard
Copied
There are two more ways you can avoid using TeaCup - if you don't need updates and can just re-generate everything from sratch if needed:
1) You could export XML from Excel.
2) You could export InDesign Tagged Text from Excel.
And if your labels are so simple - my tool also would be an overkill... Unless you need true one-click-solution and you have a lot of labels to produce.
So you only need a way to generate barcodes.
Copy link to clipboard
Copied
And here is a bit "quick and dirty" solution for exporting your pages 😉
You would've to export from Excel script with structure like this:
export_page(page_num, folder, pdf_file_name);
export_page(page_num, folder, pdf_file_name);
export_page(page_num, folder, pdf_file_name);
export_page(page_num, folder, pdf_file_name);
//...
Where in each row, istead of "page_num" you would simply put row/record number of the CSV file - which is page number in your final INDD file, instead of "folder" - full destination path, instead of "pdf_file_name" - I'm sure you know what 😉
Then, at the end - add this:
function export_page(page, folder, name) {
var pdf_file = File(folder + '/' + name + '.pdf');
app.pdfExportPreferences.pageRange = page;
doc.exportFile(ExportFormat.pdfType, pdf_file, false, pdf_preset);
}
So your sample script could look like this:
var pdf_preset = app.pdfExportPresets[0]; // High Quality Print
export_page('1', 'c:\\IDT\\', 'Outer packaging label 101131-E');
export_page('2', 'c:\\IDT\\', 'Outer packaging label 101132-E');
function export_page(page, folder, name)
{
var pdf_file = File(folder + '/' + name + '.pdf');
app.pdfExportPreferences.pageRange = page;
app.activeDocument.exportFile(ExportFormat.pdfType, pdf_file, false, pdf_preset);
}
TESTED - works 😉
So, again, you only need to find solution for generating barcodes.
Copy link to clipboard
Copied
This way - you can even name your PDFs using information that's not present in the INDD Document 😄
Copy link to clipboard
Copied
This is fantastic.
Thank you very much 🙏
I just woke up here so I will test this during the day.
And for the labels. i have a lot of labels to produce so, thousands for the coming years, soI need to find an easy solution to work with.
Copy link to clipboard
Copied
You're welcome.
You've 3x options to generate labels - all free:
1) using InDesign's built-in DataMerge - I've already posted sample files(*),
2) export XML from Excel,
3) export InDesign Tagged Text from Excel,
So, again, you only nerd to find a way to generate barcodes.
(*) I skipped there placing barcodes as images - but if you'll have files with barcodes on your drive - DataMerge will import them automatically.
Copy link to clipboard
Copied
OR...
Any chance you can switch to QR codes?
Those InDesign can generate by itself...
Copy link to clipboard
Copied
No, it needs to be bar codes.
Again, thanks. I'll try to figure this out somehow. Put all the pieces together.
Best regards Fredrik
Copy link to clipboard
Copied
https://barcode.tec-it.com/en/EAN13
You're welcome 😉
2nd code is incorrect - I've just replaced "2" at the end with "3" - to show that it works.
Copy link to clipboard
Copied
Or, instead of graphic objects - it can be done as Text:
(but it's more for future reference than for you directly Fredrik)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now