Should mpdf render using \Mpdf\HTMLParserMode::HTML_BODY

Created on 10 November 2023, about 1 year ago

Problem/Motivation

We face an issue where body styles are not rendered as expected in pdf output.

Here's the render of a Drupal body field using writeHTML with $mode 0.

And the same PDF using $mode \Mpdf\HTMLParserMode::HTML_BODY

While it may not be immediately clear from the images, in the second image, our custom CSS is being applied as expected.

See https://mpdf.github.io/reference/mpdf-functions/writehtml.html

Its not clear to me which is best. Perhaps we should make this configurable?

Steps to reproduce

Create a node with body text using a WYSIWYG editor. Render using mpdf.

Apply patch (forthcoming), comapre render of same node as pdf.

Proposed resolution

Allow changing the $mode call on writeHTML?

Remaining tasks

Research best option

User interface changes

Possible new config

API changes

Possible new config

Data model changes

Possible new config

πŸ’¬ Support request
Status

Closed: works as designed

Version

2.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024