Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusing SVG on few pages. Is it possible to make Svg cloneable? #115

Open
beling opened this issue Jan 12, 2022 · 4 comments
Open

Reusing SVG on few pages. Is it possible to make Svg cloneable? #115

beling opened this issue Jan 12, 2022 · 4 comments
Milestone

Comments

@beling
Copy link

beling commented Jan 12, 2022

I try to reuse the same SVG object on few pages.
But I cannot find any better solution than just parse the same SVG file for each page.
I found that all fields of Svg struct are clonable. Maybe it is save to just make Svg cloneable too?

BTW. Thank You for your great work on printpdf!

@fschutt
Copy link
Owner

fschutt commented Jan 16, 2022

Right now the SVG is stored on the pages /Resources dictionary, but you'd need it to be stored on the document (so that it is visible to multiple pages).

@beling
Copy link
Author

beling commented Jan 16, 2022

Thank You. Is it possible to store SVG on the document in the current printpdf version?

@fschutt
Copy link
Owner

fschutt commented Jan 23, 2022

Currently no. Right now only per-page resources are allowed, I think I have to rework the API regarding that anyways.

@fschutt
Copy link
Owner

fschutt commented Nov 2, 2024

In 0.8 the API uses an XObjectId, which should duplicate the object to the pages Resources on every page where it is used.

@fschutt fschutt added this to the 0.8 milestone Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants