felixfbecker / dom-to-svg

Library to convert a given HTML DOM node into an accessible SVG "screenshot".
MIT License
381 stars 42 forks source link

Feature request: Provide an option to split the dom in a convenient way #164

Open lestcape opened 3 years ago

lestcape commented 3 years ago

I think it's a very good idea the usage of this library to generate a pdf file of the HTML DOM, without generate a non vector image. Because currently generate a non vector image is the only way of how we can generate a pdf of the DOM in js. Please see: https://github.com/MrRio/jsPDF/issues/3222

So, one feature that we probably need to achieve this goal is the ability of generate an svg per PDF pages and this then will required split the svg in several svg with the corresponding size of the pdf page.

One basic and initial idea to split the svg could be just cut it where we can and another much more complex will required enumerate all possibilities and evaluate the better approach later. I think the print setting of Firefox and Chromium should provide a good idea of how to split the things.

lestcape commented 3 years ago

Probably the pagination technique can be implemented in one of this ways: https://github.com/yWorks/svg2pdf.js/issues/37