hunghg255 / reactjs-tiptap-editor

A modern WYSIWYG rich text editor based on tiptap and shadcn ui for Reactjs
https://reactjs-tiptap-editor.vercel.app/
MIT License
180 stars 32 forks source link

Feature Request: Export a PDF file #14

Closed condorheroblog closed 2 months ago

condorheroblog commented 2 months ago

Do you have any good ideas?

What I can think of now is to generate an HTML content and then export it to PDF

hunghg255 commented 2 months ago

we can create a new extension for exporting pdf, same idea as you, can we use Puppeteer open page after exporting the PDF? or are you know any package supports HTML string to PDF

condorheroblog commented 2 months ago

Puppeteer is excellent, but as far as I know, it runs on the server-side. What we need is to generate PDFs on the client-side. I tried https://github.com/eKoopmans/html2pdf.js, but the results were very unsatisfactory, and it's not possible to copy text from the generated PDF.

It is a big problem.🤔

hunghg255 commented 2 months ago

we can use try this lib: https://www.npmjs.com/package/@progress/kendo-drawing

I am just use it to export images, I see it has a function exportPdf