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.
The module works with Dompdf 0.8.5 but if you try to update to Dompdf 0.8.6 you receive errors like:
Error generating document: Failed to generate PDF: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
If you have similar issues downgrade Dompdf to 0.8.5:
$ composer require 'dompdf/dompdf: 0.8.5'
Comment | File | Size | Author |
---|---|---|---|
#18 | 3169624-18.patch | 1.99 KB | uditrawat |
Comments
Comment #2
oriol_e9gComment #3
oriol_e9gComment #4
oriol_e9gComment #5
r81d3r CreditAttribution: r81d3r as a volunteer commenteddowngrading to 'dompdf/dompdf: 0.8.5' worked for me. thanks!
waiting for this problem to be fixed
Comment #6
oriol_e9gComment #7
TokiThe same here, downgrading DomPDF to 0.8.5 worked for me.
Comment #8
oriol_e9gComment #9
flocondetoileSame here. downgrading DomPDF to 0.8.5 fix the issue.
Full error message
Drupal\entity_print\PrintEngineException : Failed to generate PDF: file_get_contents(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known, ... Image not found http://URLnone in Drupal\entity_print\Plugin\EntityPrint\PrintEngine\DomPdf->send() (line 192 of /private/var/www/PROJECT/web/modules/contrib/entity_print/src/Plugin/EntityPrint/PrintEngine/DomPdf.php).
Comment #10
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedThanks it worked for me too with 0.8.5.
Comment #11
chiefme CreditAttribution: chiefme commentedYes. Downgrading to Dompdf 0.8.5 worked.
Comment #12
luke.stewart CreditAttribution: luke.stewart at Fuzion commentedThis has been mentioned upstream -> https://github.com/dompdf/dompdf/issues/2244 and there is a "patch" you can apply to vendor/dompdf/dompdf/src/Css/Style.php to get around this without requiring a downgrade to 0.8.5 until this is either resolved in dompdf or this module.
Comment #13
ytsurkThe patch works. I really hope dompdf will support the non-standard CSS value url(none) for the background-image property.
I made an alternative patch, see https://github.com/dompdf/dompdf/pull/2270/commits/085a3b86a4768609ac230...
Comment #14
socketwench CreditAttribution: socketwench at TEN7 commentedI ran into this problem myself. DOMPDF seemed append "none" to any image URL so you'd get like "example.comnone" for some reason...
Downgrading worked for me.
Comment #15
ytsurkThis will be fixed with the next dompdf release.
Comment #16
sheanhoxieThe patch in #13 wasn't working for me. I also needed to adjust the method set_background_image()
Comment #17
ytsurkYou also need to watch the list-styles ;)
The latest patch from issue 2244 made it into dompdf and will be released: https://github.com/dompdf/dompdf/commit/2ee96e2885f801e120adcba36224496f...
Comment #18
uditrawat CreditAttribution: uditrawat commentedAdded similar code for list_style_image also.
It seems to be working now.
Comment #19
superlolo95 CreditAttribution: superlolo95 commenteddowngrade worked for me
Comment #20
mErilainen CreditAttribution: mErilainen at Wunder commentedSo it doesn't seem to work with dompdf 0.8.6. Should the module be updated to require dompdf 1.0.0 or greater?
Comment #21
Umac_de CreditAttribution: Umac_de commenteddowngrade worked for me too
Comment #22
joekersDowngrading didn't work for me but using patch #18 worked and seems to have fixed the errors. Thanks!
Edit: It was the "Enable Default CSS" option which 'fixed' it - this allow the PDF to be generated.