I'm experiencing a similar issue that this one with the latest update of the knp Snappy Bundle on Symfony 4.4.5.
I've set the following options and they do not help to fix the error.
options:
- { name: 'no-outline', value: true }
- { name: 'encoding', value: 'UTF-8' }
- { name: 'dpi', value: 300 }
- { name: 'orientation', value: 'Portrait' }
- { name: 'page-size', value: 'A4' }
- { name: 'page-width', value: '210mm' }
- { name: 'page-height', value: '297mm' }
- { name: 'margin-top', value: '0' }
- { name: 'margin-bottom', value: '0' }
- { name: 'margin-left', value: '0' }
- { name: 'margin-right', value: '0' }
- { name: 'disable-smart-shrinking', value: true }
Note: Changing 'disable-smart-shrinking'
to 'enable-smart-shrinking'
changes nothing. Adding the zoom
option changes nothing either.
I have checked if the options do have an effect at all and I can confirm that they have. As en example, I changed 'Portrait'
to 'Landscape'
, which indeed resulted in a landscape document.
Here is a test document showing the issue:
The blue box is the PDF that is generated by the snappy bundle. It has the correct dimensions of 210mm x 297mm
, the red-border box is the result of a div with the CSS dimensions of 210mm x 297mm
. There is clearly something off.
How can this be fixed?