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

Unsupported features/Known issues #82

Open
HackbrettXXX opened this issue May 6, 2019 · 22 comments · Fixed by #140
Open

Unsupported features/Known issues #82

HackbrettXXX opened this issue May 6, 2019 · 22 comments · Fixed by #140

Comments

@HackbrettXXX
Copy link
Member

HackbrettXXX commented May 6, 2019

Here is a list of known issues/unsupported features.

  • foreignObject support
  • transforms on elements other than path within clipPath
  • textPath attribute
  • text stroking
  • textLength attribute
  • glyph elements
  • mask and filter elements
  • animations
  • most units other than px
  • different opacities on gradient stops
  • use elements with non-local IRI references
@HackbrettXXX HackbrettXXX pinned this issue May 6, 2019
@bernhardreiter
Copy link
Contributor

To me it would make sense to put the feature "Images with urls that are not inline data urls" in an issue
on its own. There is the jsPDF.addImage() module which could be looked at for the functionality.

@HackbrettXXX
Copy link
Member Author

The addImage plugin also basically only supports data urls. I just saw that the original jsPDF made some changes to support other urls via synchronous requests. Synchronous requests are deprecated and should usually not be used, though. As far as I can see there is also no option to preload images. So we can support non-data-urls only when we make the API of svg2pdf asynchronous. This should be done together with a 2.0 release.

@eliaschaflo
Copy link

I tried rounded corner rects (rx attribute), but the pdf export ignore this attribute.

@HackbrettXXX
Copy link
Member Author

As far as I know, the rx/ry attributes are fully supported. Are you sure your SVG is correct? Could you give us a snippet of your SVG?

@eliaschaflo
Copy link

Yes you are right! This was showing good in the browser but not in the pdf
<rect width="60" height="60" rx="15" />
I had to add ry value and now works perfectly fine.
<rect width="60" height="60" rx="15" ry="15"/>
Thanks por pointing that it is supported!

@HackbrettXXX
Copy link
Member Author

Actually, your SVG is right. MDN states

If a properly specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one.

So omitting one of the values is correct. We should fix this (#126).

@eliaschaflo
Copy link

Hi again. Wanted to know if the text style attribute 'font-weight' is implemented.
I am using it and the svg shows correctly but the pdf looks 'regular' everywhere. Is there something I am doing wrong?

@eliaschaflo
Copy link

Interesting! It works by using 'bold', 'normal' but not with numeric value. Anyway, would like to add a 'light' type with the existing fonts.

@HackbrettXXX
Copy link
Member Author

Yes. This is mainly because jsPDF only supports 'normal', 'bold', etc.. With custom fonts and some tricking, we might be able to support other font styles, though. When adding a font to jsPDF, you can also specify the font-style, which in theory, could also be a numeric value. Needs to be tested though.
Also, svg2pdf needs to support numeric values. Created a new issue (#128).

HackbrettXXX added a commit that referenced this issue Jul 17, 2020
- when rx===ry===0 write a regular rect instead of a rounded rect with 0 radius

fixes #82
@HackbrettXXX
Copy link
Member Author

Ah, accidentally copied the wrong issue number in #140.

@xurenda
Copy link

xurenda commented Nov 9, 2021

Unfortunately does not support filter elements, my svg has Gaussian blur and shadows, is there any way to work properly in pdf again?

@HackbrettXXX
Copy link
Member Author

AFAIK, PDF has no native feature like SVG filters. A workaround might be to replace all elements with filters in the SVG with <image>s of the rendered element.

@vitornvpaixao
Copy link

Hi, there is any way to add multiple svgs instead one?

@yGuy
Copy link
Member

yGuy commented Dec 3, 2021

Hi, there is any way to add multiple svgs instead one?

Sure, just make more calls to doc.svg(...)

@vitornvpaixao
Copy link

Hi @yGuy, thanks for your quick answer. I already tried but with more than one is not rendered in pdf.
This pdf has only one page with a canvas image, and i'm trying to add multiple svg (with paths) layers above this image.

@HackbrettXXX
Copy link
Member Author

Did you confirm the SVGs are in fact not there? Are they maybe just occluding each other? Please check if maybe something else is going wrong... maybe not all calls to doc.svg() are actually called? If you think this is an issue of svg2pdf, please provide a runnable example, so we can reproduce the issue.

@vitornvpaixao
Copy link

Hi @HackbrettXXX, i will analyse what might be going through and if necessary i will open an issue with a runnable example. Thanks boths for your help.

@xurenda
Copy link

xurenda commented Dec 23, 2021

Hi, please tell me why mask is not supported. As far as I know, pdf should support masking.

@HackbrettXXX
Copy link
Member Author

@xurenda You are right, PDF supports masking and it would probably be possible to add support for the feature. It just hasn't been implemented so far, because it's used rather rarely. We would happily merge and assist with a pull request, though. Although we need to add the masking feature to jsPDF, as well, first.

@xurenda
Copy link

xurenda commented Dec 23, 2021

@HackbrettXXX Okay, thank you for your reply, I need the mask very much, but I am not good enough, I hope someone can solve it.😄

@iziorama
Copy link

iziorama commented Jun 5, 2022

HI! Did you have a plan to support CMYK colors as jsPDF supports it?
Maybe using custom property like device-cmyk=""

@eriese
Copy link

eriese commented Jul 22, 2022

I'd be very grateful for support for transform-origin!

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

Successfully merging a pull request may close this issue.

8 participants