We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image and text are not being aligned in center ?
const savePDF = () => { var HTML_Width = document.querySelector("#appp").clientWidth; var HTML_Height = document.querySelector("#appp").clientHeight; var top_left_margin = 0; var PDF_Width = HTML_Width + top_left_margin * 2; var PDF_Height = PDF_Width * 1.5; var canvas_image_width = HTML_Width; var canvas_image_height = HTML_Height; var totalPDFPages = Math.ceil(HTML_Height / PDF_Height) - 1; html2canvas(document.querySelector("#appp"), { useCORS: true, scale: 1.8 // allowTaint: true }).then(function (canvas) { canvas.getContext("2d"); let img = new Image(); //@ts-ignore img.src = canvas.toDataURL("image/png"); var pdf = new jsPDF("p", "pt", [PDF_Width, PDF_Height]); // var pdf = new jsPDF("p", "pt", [PDF_Width, PDF_Height]); pdf.addImage( img, "JPG", top_left_margin, top_left_margin, canvas_image_width, canvas_image_height ); pdf.save("HTML-Document.pdf"); }); }; return ( <div onClick={() => closeModal()} className="fixed inset-0 flex items-center justify-center z-50 bg-opacity-30 bg-black backdrop-blur-[3px]"> <button onClick={savePDF}>Generate PDF</button> <div id="appp" style={{ width: 800 }} className='bg-white'> <div className="flex items-center gap-2"> <img src={Email} /> <span>Hello</span> </div> </div> </div> )
The text was updated successfully, but these errors were encountered:
I want to work on it.can u assign it to me?
Sorry, something went wrong.
Bonjour, je souhaite participer à la résolution de ce problème. Pouvez-vous me l'attribuer ?
this also happens to me with ol list, list-style decimal (numbered list) in the html it looks good and this is the pdf:
ol
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
Successfully merging a pull request may close this issue.
Image and text are not being aligned in center ?
The text was updated successfully, but these errors were encountered: