react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

feat: add svg viewer

Open diegomura opened this issue 4 years ago • 0 comments

This is the first step for having other "viewer" or outputs of this lib rather than just PDF format.

This adds a new SVGViewer component, an alternative to the pre-existing PDFViewer. PDFViewer just uses an iframe to render the doc, that creates inconsistent behaviour cross-browsers and OSs, and does not work well on mobile. SVGViewer renders the document in SVG, which makes it possible to style the viewer in a custom and reliable way. It's also much more performant since there's no need to actually create the PDF document (it just grabs the layout data and renders it in SVG). The PDF creation can be delayed right to the moment of wanting to download the document

This is still a WIP

diegomura avatar Sep 04 '21 19:09 diegomura