dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.39k stars 77 forks source link

Repeated SVG without re-rendering? #80

Open urkoben opened 2 years ago

urkoben commented 2 years ago

If I have to insert the same SVG image X times in a PDF, is there any way to avoid re-rendering it all the times?

Something like cache the parsed files, and for duplicate files, copy then from cache and transform to x,y.

Thanks.

bsweeney commented 2 years ago

Are you talking about placing the same SVG on multiple pages, or on the same page in various locations? It's likely possible, but the actual method would depend on the PDF back end.

urkoben commented 2 years ago

On one or more pages, on multiple locations on each page.

I asking this because some pdf i'm generating (list of products) takes too much time... the time looks going mainly on the 120 SVG rendering, but they're all repeated...

Thanks.