Exporting HTML canvas to PDF & PNG using JS

When exporting the content of a whiteboard web app, we are exporting the content of an HTML canvas element to PDF format(Vector Image) or PNG(Raster Image). This post will introduce the basic method for exporting the content of HTML canvas and also some issues we encountered when working on this feature. Export to PDF Export method We’ll use PDFKit to generate the PDF file. We have the SVG string as the source for the vector format of the content we draw on the HTML canvas element....

February 17, 2024