if you're printing on a label sheet (i.e., self-adhesive, pre-cut labels), then you're going to need an accurate template.
Generating a PDF is probably still your best option, but you're going to have quite a task in front of you getting the dimensions and positioning right - you won't be able to simply use the default options of whatever PDF converter you decide to use.
The alternative would be to make a print stylesheet for your labels, and use physical dimensions (cm, etc.). I don't know how reliable that would be, with browsers and OS's all competing for control of the printer (thinking of the margins/gutter in particular).
randomanon;11000770 wrote:... the size in question for printing is 38x90mm or 143px x 340px the model is known as QL-570 from Brother.
As Bonesnap mentioned, px and mm are completely different and you can't determine one value based on the other. 143px x 340px can be printed at 14mm x 34mm just as easily as 2860mm x 6800mm (assuming you have a printer that big).
Question: since you know what printer you're using, it would stand to reason that this is for a very narrow deployment: why are you using PHP? Isn't there some sort of software that came with the printer? Or even just a template for a regular word processing program?