php-svg-lib icon indicating copy to clipboard operation
php-svg-lib copied to clipboard

Repeated SVG without re-rendering?

Open urkoben opened this issue 4 years ago • 2 comments

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.

urkoben avatar Jan 22 '22 11:01 urkoben

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.

bsweeney avatar Jan 22 '22 17:01 bsweeney

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.

urkoben avatar Jan 22 '22 17:01 urkoben