Skip to content

Unable to render react components into PDF #1292

@steric85

Description

@steric85

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF?
Yes

Have you tried using jspdf.debug.js?
No

What I saw
jsPDF does not render the react components into pdf. Is this functionality not provided or am I making any mistake in writing the code?

     <div>
        <div id="HTMLtoPDF">
            <HelloWorld name="Rambo"/>
            <HelloWorld name="Riya"/>
            <HelloWorld name="Rose"/>
            <h2>Is it converted?!</h2>
          <center>
            <h2>HTML to PDF</h2>
           <p>Lorem ipsum dolor sit amet, consectetur adipisicing </p>
          </center>
          <button>Hi, Click me</button>
          <img src={puppy} />
        </div>
        <button onClick={this.pdfToHTML}>Download PDF</button>
      </div>

When the above code is written in render() , all the components and tags are displayed in the browser. But when download the pdf, neither the buttons nor react components are getting converted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions