I have a website that does invoice creation, these are in the form of images 800px wide. The invoices are intended to be printed on 4" continuous feed paper (kind of like receipt printers at the store).
I'm currently playing around with width and margin CSS settings like this:
@media print {
.invoice-image {
width: 425px;
margin-left: -50px;
}
}
Adjusting the width and margins doesn't seem ideal. Especially since I have to push to QA each time (which is a 5 minute wait) to see the results of my changes due to the printers only working with the iPads. Is there an easier way for me to scale the image as needed to the size of the paper? Something like view-port maybe?
question from:
https://stackoverflow.com/questions/66050734/css-scale-image-to-printer-paper-type 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…