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.
Hey,
I need to use wkhtmltopdf in a project where large PDF with 1000 pages lead to timeouts with mpdf. With mpdf the generation took 7 minutes - with wkhtmltopdf it takes just 30 seconds.
The mpdf library handler module already offered the possibility to alter the created mpdf object. For wkhtmltopdf something like that is missing. In my situation I needed to change the paper size depending on the path where the PDF is created. By now this library handler module is very static in this point.
I will try to offer a patch in a short time for that.
Best,
Tobias
Comment | File | Size | Author |
---|---|---|---|
#1 | print-alteration-of-options-wkhtmltopdf-2497071-0.patch | 3.86 KB | tobiberlin |
Comments
Comment #1
tobiberlinHere is a patch. Options are turned into an array so it might be good to save the default options as an array in variable 'print_pdf_wkhtmltopdf_options'?!
Comment #2
mortona2k CreditAttribution: mortona2k at Forum One commentedI did a similar, but much simpler tweak, basically just this line:
I was just trying to set wkhtmltopdf options based on the url. I can see how using arrays makes this much more manageable, and I hope we can get comment from module maintainers about saving the options variable as an array.
The patch diff looks sensible to me, hopefully someone else takes a deeper look.
Comment #3
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedYes, something like #3053844: add hook for print_pdf_wkhtmltopdf seems saner at this stage of the process.