yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
649 stars 98 forks source link

Multiple SVG in 1 pdf support #193

Closed jaimecigna closed 2 years ago

jaimecigna commented 2 years ago

I am trying to use SVG2pdf to render multiple SVG's on 1 PDF.

Is this supported??

It doesn't seem to work when I try to use : pdf.svg() inside of a forEach loop.

Any Help would be appreciated!

HackbrettXXX commented 2 years ago

That's probably because pdf.svg() is asynchronous. Use a for loop with await or something similar.

jaimecigna commented 2 years ago

good idea, i'll give a for loop a try. thanks for the suggestion

jaimecigna commented 2 years ago

That's probably because pdf.svg() is asynchronous. Use a for loop with await or something similar.

Thanks for the suggestion, it worked!