Every web browser's printing engine has its unique ways of converting HTML CSS text into PDF vectors. The programmers behind Chromium have dedicated countless hours experimenting with various methods and permutations to achieve the desired results.
While I won't delve into suggesting specific styles, it is worth noting that Chromium's capabilities enable it to generate outputs that may not always align perfectly with PDF standards. Nevertheless, it gets the job done.
https://i.sstatic.net/GP34u77Q.png
Why do some websites disable text shadows when printing? The primary reason is the significant strain it puts on system resources.
A seemingly insignificant 20-byte text without fonts can consume a whopping 3MB of memory during the rendering process.
https://i.sstatic.net/6m6Ee3BM.png
I deliberately adjusted the outer boundary to illustrate why this poses a challenge in PDF production.
To create a shadow effect, multiple images at varying opacities need to be layered to mimic a realistic shadow. While compression can alleviate the issue post-construction, each additional shadow increases memory usage during both writing and reading processes.
You might think this doesn't concern you, but the use of text shadows should be avoided as it adversely affects visually impaired individuals who rely on screen readers. They interpret shadows as multiple overlapping descriptions of the same text.
HHHEEELLLLLLOOOWWW WWWOOORRRLLLDDD
If you require a box shape with text overlay, opt for a single repeatable image serving as the background. By using the same JPEG image at maximum quality, storage efficiency increases significantly after repeated use.
This amounts to 28.4 KB (29,155 bytes), only slightly larger than an individual image with overlays of translucent colors.
https://i.sstatic.net/LJGNhYdr.png
1 img = 25,947 bytes
https://i.sstatic.net/fSOoUq6t.jpg
https://i.sstatic.net/Jf1tUkJ2.png