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

[BUG] SVG images are not inserted correctly #572

Open
njkleiner opened this issue Nov 1, 2024 · 3 comments
Open

[BUG] SVG images are not inserted correctly #572

njkleiner opened this issue Nov 1, 2024 · 3 comments

Comments

@njkleiner
Copy link

Description

Some kinds of SVG images cannot be drawn on a PDF page using creator.NewGraphicSVGFromFile.

Expected Behavior

The SVG image should be drawn on the page.

If the SVG image cannot be drawn for whatever reason (e.g., the particular structure used within the SVG file is not supported), calling creator.NewGraphicSVGFromFile should at least return an error instead of panicking.

Actual Behavior

We can observe the following two outcomes (depending on the SVG image input file):

  • creator.NewGraphicSVGFromFile does not return an error, but the image is not drawn on the page.
  • creator.NewGraphicSVGFromFile panics.

See the pflege-de/unipdf-issue-insert-svg repository for a full proof-of-concept program that can be used to reproduce the issue, including various example SVG files.

See the README of the repository for more information, including concrete reproduction steps.

Copy link

github-actions bot commented Nov 1, 2024

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

@anovik
Copy link

anovik commented Nov 12, 2024

@njkleiner Thanks for your test repo and data you've provided, that was very helpful to us.

We've done several enhancements related to SVG and they will be included into UniPDF release later this month, we will notify you when it will be available.

The enhancements include fixes for both panics you've found and processing of 'transform' attribute. For 2 files from your test set there is still a problem with displaying related to 'defs' attribute but this is already included into our roadmap for next releases.

@anovik
Copy link

anovik commented Nov 25, 2024

@njkleiner The new UniPDF release is out https://github.com/unidoc/unipdf/releases/tag/v3.64.0 could you please test SVG improvements?

Thanks for your cooperation.

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