I also struggled with the HTML / CSS approach due to inconsistent print behavior in browsers.
I created a C # library for creating Avery shortcuts in PDF from ASP.NET, which I hope may be useful:
https://github.com/wheelibin/SharpPDFLabel#readme
You can add images and text to tags, as well as easily define more types of tags.
(I use it for barcode shortcuts, the barcode is generated as an image, and then added to the label using this library.)
Greetings
source
share