you say PDF would work great for this, please elaborate, if you don't mind.
It is great because you can control everything from
exact positioning of the elements (impossible to do in a browser because there are too many variables to consider, such as resolution).
Wouldn't that put extra load on the server?
Of course it will, to what extent I am unsure. There are several weighing factors, such as how many hits and concurrent pdf generations you have going simultaneously. Anything you add to your page is going to increase server load in one way or another
And if I create a PDF file to be printed, then the client would need a PDF viewer to open, and the print it, right. Is there a way of the PDF file being printed automatically, on the fly?
Right. But remember we are trying to avoid printing from the browser because lots of bad things can happen there. Labels could be split in half at the page breaks, etc. I really don't see the inconvinience of this, it is one minor step of a program being automatically opened, and clicking print from there instead of the browser.
Now you have no excuse
But this still doesn't answer my other question (unless I don't understand all your answers). Is there a way for the user to design the label layout? Or will it have to be pre programmed into the script? What happens if they want to change the layout, to let's say bigger labels (meaning there will be less labels on the page), or they want to print to a label printer, which has a single row of labels, instead of an A4 sheet with either 2 / 3 / colomns with labels.
If you take some time to look at the functions for modifying and creating PDF documents, you'll find it is extremely customizable. I have been using PDF generation to generate reports with several different optional templates, store in the database. Having a couple saved templates would be ideal and allow the user to choose, but the power comes in since you could allow users to select the dimensions, etc.
Now the more user modifiable you want this the more complex it's going to get, obviously. Your going to have to make several calculations on how many labels you can fit on a page (which shouldn't be too dificult) without having labels overlapping or whatever. I would keep it simple by offering a dozen or so different templates each with different dimensions, that way you can avoid all the hassle in the first place.
Is this getting too technical? Kbarcode has a MySQL database with plenty Avery type labels, which I'm sure I can use as a base for the label sizes? But let's say they get custom size labels which they want to print on, I should have a way of them adding a label into the system. How would I be able to work around that? To me it sounds like I would need to make my HTML tables dynamic, but how? Somehow I would then need to let the system know that it needs to print 2 rows of labels, 50mm from either side, 20mm apart, and 10 above the previous one. Does HTML know about METRICS, or does it only work with pixels?
Back to my last point, this can get overly complicated with how you are wanting to approach this. First of all, you are not using html, you are creating shapes and lines with positions on the sheet.
Have a read of the pdf library function.