I create a PDF (using php library mPDF) with a full size background image on the body tag:
body {
background: url("..path/to/bg.jpg") center no-repeat;
background-size: cover;
background-image-resize: 6;
background-image-resolution: 300dpi;
}
It looks just fine in Chrome's, IE's and Acrobat's PDF viewers, but horrible in FF:
Any idea how I can handle this for Firefox? I played with the CSS, using width and height, different resolutions, embedding as .svg, but to no success.
It's caused by a bug in Firefox's pdf.js
that manifests when PDF files were generated from mpdf with background: no-repeat
on its HTML source.
As a work-around, removing the no-repeat
property avoids the bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With