Thanks @tmaier for this surpisingly simple but highly effective method to print ASN labels!
Please don't get offended by the title. I'm quite confident, that you have testet this, but it doesn't work here and I would like to get to the bottom of it ;)
When I startet to print the first labels (on Avery L4731 forms), I encountered a missalignment of the rows.
The first label in a row matched, but each succeeding label lacked a tiny bit, adding up to approx 2-3mm offset on the last label in the row.
The spacing on the vertical rows looked good, though.
At first, I suspected the printer driver (Brother) - and in fact #1 indicates, that there may be issues - but besides some eventually required adjustments of page margins, I could not find any (scaling) problem with the driver.
To rule that component out, I let Chrome print directly to PDF (not via the printer driver!) to be able to verify what is actually generated.
I used the rulers and helper lines of "PDF Xchange Viewer" to exactly measure the placements of the elements in the PDF - and somehwat surprisingly they matched my manual measurements of the printout!
Ok, given that, I now dived into your HTML/CSS code. While I'm certainly no expert in that matter, I tried to follow the formating directions: (Please correct me, if I got something wrong)
- Each element is 25.4mm wide (
w-[25.4mm]
)
- Between each element is a gap of 2.5mm (
gap-x-[2.5mm]
)
- Calculating the distance from the left edge of the first to the last element would then by 6 * 25.4 + 6 *2.5 = 167.4mm.
All that matches my measurements of the Avery L4731 form! So all good there, obviously.
Now, if I perform the same measurements on the generated PDF, I got this:
- The distance between the left edge of first and last element is only ~165mm
- The difference accounts exactly for the offset-skew seen on the printouts.
I would conclude that there is some rendering issue of the page in Chrome!?
I've attached the generated PDF for your reference.
asn_orig-tmaier.pdf
Any thoughts welcome.