I'm using the Barby ruby gem which adds a handy way to render barcodes as HTML.
Barby renders a table with td
backgrounds on or off based on the code passed to it. This works pretty well because I don't want to generate and store an image file for every record I need a barcode for.
The major browsers don't print background colors by default and I need the barcode to print without making the user change a print option on their local system.
I'm not sure how to accomplish this with Firefox. With webkit (Chrome and Safari), it's pretty easy:
td {
background: #000 !important;
-webkit-print-color-adjust: exact;
}
Feverish Googling hasn't really gotten me anywhere: This question is a few years old and I haven't found anything newer so I figure I'd pose the question again. Fat borders also won't really work because if the relationship between the bars change, it'll change the data contained in the code.