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

Filters in SVG Not Exported Correctly to EMF #1

Closed
Teddy-van-Jerry opened this issue Dec 4, 2023 · 1 comment
Closed

Filters in SVG Not Exported Correctly to EMF #1

Teddy-van-Jerry opened this issue Dec 4, 2023 · 1 comment
Assignees

Comments

@Teddy-van-Jerry
Copy link
Owner

Problem Description
When the exported SVG contains filter, for example filter="url(#filter-remove-color)" and filter="url(#filter-color-to-alpha)", Inkscape will ignore the filters, resulting in display errors in EMF.

Problem Causes
Let's analyze the problem step by step. It is a chain of dependency issues that we can hardly mitigate in this project.

  1. Firstly, when the PDF contains some images with transparency, pdf2svg will convert them as <image /> with filters used. This behavior, unfortunately, goes down to its own dependency.
    Image converting dawbarton/pdf2svg#22
  2. When Inkscape ignores filters, the transparency is gone, resulting in black blocks which are annoying.
    https://gitlab.com/inkscape/inbox/-/issues/3858
    https://gitlab.com/inkscape/inbox/-/issues/2275
  3. As such, the generated PPT file is not accurate and requires manual editing.

Mitigation Thoughts

  1. The first thing to avoid is using transparency in creating PDF (I think you are using LaTeX with the beamer class), though this can be hard. Avoid PNG with transparency. Avoid using PDF generated from other applications (which can contain transparency somewhere you are unaware of). The alternative is to always favor TikZ, which produces better quality. Note that try to reduce the use of opacity in TikZ as well, and use pseudo-opacity, like blue!10 on a white background.
  2. I will do some checks on SVG in the pdf2ppt project to produce warnings on affected slide pages, so you can copy and paste the original SVG to PPT manually.
@Teddy-van-Jerry Teddy-van-Jerry self-assigned this Dec 4, 2023
Teddy-van-Jerry added a commit that referenced this issue Dec 4, 2023
More info will be added to #1.
@Teddy-van-Jerry
Copy link
Owner Author

Now a warning will be displayed when such problems are detected, for example

WARNING: Pages [1, 3, 10] may not be correct, please double check.
         You can manually copy the generated SVG images to PPT.
         (More info: https://github.com/Teddy-van-Jerry/pdf2ppt/issues/1)

The SVG images of affected pages will be copied to another folder, which will not be cleaned after running.

The check behavior can be disabled by specifying --no-check.

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

1 participant