Skip to content

[Feature request] Generating the PDF from HTML DOM element which has Images and Mathematical equations. #161

@vinay-ramesh

Description

@vinay-ramesh

Hello!

When using react-to-pdf to generate a PDF from my React application's content, mathematical and chemical equations (rendered via MathJax) are not appearing correctly in the final PDF output. They are either missing, malformed, or their layout is significantly distorted compared to their appearance in the browser.

To Reproduce:

Render a React component containing mathematical/chemical equations that are processed by MathJax.
Use react-to-pdf to capture and generate a PDF of this component.
Observe the generated PDF.

Expected Behavior:
The mathematical and chemical equations in the PDF should render accurately, maintaining their correct appearance, formatting, and layout as displayed in the browser through MathJax.

Actual Behavior:
Equations are either incomplete, corrupted, or have significant visual discrepancies (e.g., incorrect alignment, overlapping symbols, missing parts) in the generated PDF.

Context:
My application dynamically generates content that includes MathJax-rendered equations. The react-to-pdf library is being used to convert a DOM element (targetRef) into a PDF.

I hereby attaching the pictures for further reference

Image
Image
Image
Image

Any guidance would be greatly appreciated. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions