3

I have html stored in "a" variable I want that html to be converted into Pdf. I am using React-PDF component

In <Document> File key it is checking for file to be in PDF.

Please Guide me how to convert the html to pdf.

a = <p style="text-align:center">PRIVATE &amp; CONFIDENTIAL</p>

     <p style="text-align:center">PREFERENCE SHAREHOLDER&rsquo;S AGREEMENT</p>

      <p style="text-align:center">BETWEEN</p>




<div>
    <Document
        file={a}
          onLoadSuccess={this.onDocumentLoad}
            >
       <Page pageNumber={pageNumber} />
                                            </Document>
                                            <p>Page {pageNumber}</p>

                                            <button onClick={() => this.setState(prevState => ({ pageNumber: prevState.pageNumber - 1 }))}>
                                            Back 
                                            </button>
                                            <button style={{margin: "0px 0px 0px 7px"}} onClick={() => this.setState(prevState => ({ pageNumber: prevState.pageNumber + 1 }))}>
                                            Next 
                                            </button>


                                          </div>
4

0 回答 0