Forum Moderators: phranque
I would like to develop a program that will generate these labels based upon the content of any particular order. Let's say my customer ordered 2 each of Product A, 1 each of Product B and 1 each of Product C. On my Admin panel, I'll have a screen showing this customers order number, and when selected, the correct labels for each of the products will be generated and the entire print job (all labels for the order) would then be submitted to the local printer.
I've been looking around at SourceForge and Zend for something that will do this, but I'm feeling kinda outnumbered.. so what I'm asking is if someone can point me in the right direction.
A less elegant approach might be to create each individual label, and have them stored in a database as an image. Then I could simply pick and choose from the database. The information I lack for this approach is how to generate a template on the fly (for the Avery label), and send this to my printer from a web based application.
Any direction to solving this would be greatly appreciated.
gracias
I created a document, labels.htm. It contains a 2 column table, to correspond with my two column form. I populated the table with text and images.
The php script is avery1.php, and contains 3 lines:
<?php
header ("Content-type: application/msword");
header ("Content-Disposition: attachment; filename=report.doc");
include('labels.htm');
?>
It's a simple process to create report.doc in Word, using an Avery template.
Execute the script, and Word opens "report.doc" ready to print. The hard part was finding a reference for it out there... The fun part can begin now. labels.htm will have to be dynamically generated. That leaves me to try to create labels on the fly, using a basic Tiff image and adding text - or to retrieve individual labels, stored as images, from a database. Any thoughts on which might be better and why?
And, someone still has to load forms in the printer. Oh well.
It takes quite a bit of tweaking and absolute positioning, and the user has to do some page setup before printing them, but when all this is done, it works great!
I have about 5 different templates right now, including the 3 across 10 down mailing label, which is the most used.
Even as I've just begun this project I can see where three different templates would be useful. Should I assume that your documents are dynamically generated, and that you rely heavily on CSS for the positioning? Using Word isn't a problem, today. But tomorrow we could be using a system without MS (can't a fellow dream?). Printing directly from the browser is appealing.
I still have a question (in my mind) about these images of mine. It's still early on, and I hope I can find a way to place a text box on my image. Otherwise I'll have to create thousands of unique images; not something to relish.
I've been looking around at SourceForge and Zend for something that will do this
I've looked around for this too, and I ended up leaning towards PDF. It looks pretty easy to build PDF label templates with the R&OS PDF class. No futzing with print settings needed with a PDF.
My label project is still languishing on my todo list, but I'm planning on giving it a go in PDF when the time comes.
It takes quite a bit of tweaking and absolute positioning, and the user has to do some page setup before printing them, but when all this is done, it works great!
I tried PDF, and ended up designing my layout with CSS. I couldn't get page breaks to work at all! Maybe later... for now I let you print one page, and let you pick a start position on that page. If there are more labels, select buttons will let you print those. Another feature is the ability to select any one label, and print in any location on the form. With a little page setup, as previously mentioned, we can print an order number on the edge of the form.
Now all that remains is to print shipping labels and set up more product labels.
Thanks for all the ideas. I'm dang near a hero again, and I owe it all back here. The next round's on me.