We currently generate our own barcodes and generate a page using the barcode images; however, we also want to print these barcodes onto a template. So far we have tried simply matching the margins and spacing (with CSS) using the measurements in the template above, but each browser is just too inconsistent. Does anyone have an idea how this can be done, preferably on the client side?
The PDF format was created to create typographically consistent output. The browser was not created with that goal in mind and today's browsers are simply not designed to do that.
You can generate a PDF and let your user print that.