Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I managed to get dompdf library working and the Printer Friendly Version displays correctly. However, the PDF Version displays rotated text in the wrong position.
The style I use in print.css for rotating text is
.deg45{
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
float: left;
margin-right: 7px;
}
Comments
Comment #1
Yuri CreditAttribution: Yuri commentedI managed to get dompdf working to some degree, by copying the theme styles to the print.css file in the print module. I know this is not the best way to do it, but using a print.css file in my theme directory, did not work.
However, there are differences between the 'printer friendly version' and the 'PDF version' generated.
My concern is specifically about the rotated text, which rotation works for both printer version and PDF versions, but the PDF version has not positioned the text in the right place.
THE PRINTER FRIENDLY VERSION (displaying correctly)
THE PDF VERSION (not displaying correctly: wrong position of rotated text)
THE HTML USED BY THE PRINTER FRIENDLY VERSION
I thought it might have to do with the float: I edited the dompdf_config.inc.php file:
def("DOMPDF_ENABLE_CSS_FLOAT", true);
However, that did make no difference in the output.
Why is the PDF rendered differently from the printer friendly version? Is this by design in the Print module or the dompdf library, or can this be tweaked in order to work correctly?
Comment #2
Yuri CreditAttribution: Yuri commentedComment #3
Yuri CreditAttribution: Yuri commentedComment #4
jcnventura CreditAttribution: jcnventura at Wunder commentedDefinitively an issue with dompdf.