-
Notifications
You must be signed in to change notification settings - Fork 104
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
Pattern inside SVG not influenced by SVG offset inside PDF, unexpected point of origin #212
Comments
Thanks for the bug report. I was able to reproduce it. |
Hi, I just wanted to ask, if there is any development in this matter? Because this became kind of a pressing matter for me, so I forked svg2pdf and tried to analyze the issue with a collegue.
|
Unfortunately, there was no progress, here, so far. We would have removed the "help wanted" tag if we were working on the task. HackbrettXXX is not available at the moment and won't be for the next couple of months, as far as I can tell. I am sorry to say, so we depend on the community to step in. Is this a problem with the way we interpret the SVG or is this a problem with the way js2pdf writes the PDF? Have you been able to narrow down the issue? What are the corresponding involved specs for the behavior? |
I have looked into the issue and I am trying to fix it. In my research, I have found some other issues:
I'll find these bugs and create a PR which hopefully resolves all these issues. |
After further investigation, we found a solution for the scaling problem in units besides The tiling pattern doesn't start at |
I tried the fix from @DanielBretzigheimer 's PR, it is working 😄 |
I found another related problem with the pattern in PDF, it also doesn't consider viewbox values of the svg. It just alsways shows the same part of the pattern as if there was no viewbox on the svg |
Is there any update to this? Without fixing this issue, it is not possible to use any types of pattern objects in combination with this lib. |
That's not true. For one, there have been improvements (check the commits above) and secondly "not possible to use any type of pattern" is wrong. Many patterns do work. Which one specifically does not work for you? Can you share a repro? |
Thanks for your answer.
|
OK. So to summarize: there are still cases that don't work for you, but the feature does work for many other patterns. You helped try to solve the issue (thanks!) but you were unsuccessful and need help. That's what the tag at this issue says. So I guess the answer to your question is: no, there aren't any updates, sorry. If you can find someone who can fix it for you, we will be happy to accept a PR. If this is super important to you, you could open a bounty and have someone work on it. |
Correct. I hope to be able to look into it myself in a few weeks again. |
I have a SVG containing a pattern and a rect which is filled with said pattern:
When I convert to PDF with a x and/or y offset then the pattern doesn't inherit the offset. It doesn't start at (0, 0) of the SVG inside the PDF but apparently the pattern starts at (0, 0) of the PDF.
And when I print the PDF then the printer adds some margins of its own which offsets the pattern again so that the printed element filled with the pattern doesn't look the same as its counterpart on the screen.
I know that the pattern inside a SVG always starts at (0, 0) of the SVG itself.
This is the behavior I would also expect to be seen in the PDF. Pattern should start at the origin of the SVG inside the PDF not the origin of the PDF.
pattern_no_offset.pdf
pattern_with_offset.pdf
The text was updated successfully, but these errors were encountered: