ropensci / rsvg

SVG renderer for R based on librsvg2
Other
95 stars 1 forks source link

transform statement #4

Closed UlrichRe closed 7 years ago

UlrichRe commented 7 years ago

Hi Jeroen,

thank you for your work. I would like to use rsvg to convert an svg character string to a pdf file, but it looks to me that there is an issue with inner nodes transform statements.

F.i. look in the attached example svg.test.pdf at value 8,4 of node 'RND (Plan) [J]'. Value 8,4 should be right-aligned in column 'Total', but it is displayed too far left. File svg.test.pdf was generated by rsvg from svg character string in file svg.test.txt. file svg.test.safari.pdf was generated from svg.test.txt in Safari and looks correct. ( svg.test.txt also is presented correctly in Chrome.)

Regards, Ulrich

svg test.pdf svg test.txt svg test safari.pdf

jeroen commented 7 years ago

You have to ask rendering questions to the librsvg folks: https://wiki.gnome.org/LibRsvg. The R package only has bindings to librsvg2, it does not actually implement the rendering. I suspect that your svg file is malformed in some way though.

UlrichRe commented 7 years ago

Hi Jeroen, thank you for your reply!  Regarding your suspect that the svg file is malformed:

Do you still think it is just a question of rendering which has to be addressed to the librsvg folks? Best regards,Ulrich

Jeroen Ooms <notifications@github.com> schrieb am 14:16 Donnerstag, 24.November 2016:

You have to ask rendering questions to the librsvg folks: https://wiki.gnome.org/LibRsvg. The R package only has bindings to librsvg2, dit does not actually implement the rendering.I suspect that your svg file is malformed though. Chrome also did not want to open it for me. How did you generate it?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

Yes you will have to ask this on the librsvg mailing list or bug tracker. The R package only has a bindings, it does not control the rendering in any way...

UlrichRe commented 7 years ago

ok, thanks for your hint.I reported an issue: Bug 775350 – incorrect text alignment in the rendering of an svg tree Regards,Ulrich

Jeroen Ooms <notifications@github.com> schrieb am 20:05 Montag, 28.November 2016:

Yes you will have to ask this on the librsvg mailing list or bug tracker. The R package only has a bindings, it does not control the rendering in any way...— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

UlrichRe commented 7 years ago

Hi Jeroen, there is a question from the librsvg folks:  André Klapper 2016-11-29 16:37:38 UTC Which exact librsvg version is used? https://bugzilla.gnome.org/show_bug.cgi?id=775350 Regards,Ulrich

Jeroen Ooms <notifications@github.com> schrieb am 20:05 Montag, 28.November 2016:

Yes you will have to ask this on the librsvg mailing list or bug tracker. The R package only has a bindings, it does not control the rendering in any way...— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

Which operating system do you use? On Windows the package uses librsvg-2.40.16. On other systems it depends on what is installed on your system. But I think this problem appears with the latest version as well.

UlrichRe commented 7 years ago

I am using macOS Sierra.

Jeroen Ooms <notifications@github.com> schrieb am 11:33 Samstag, 3.Dezember 2016:

Which operating system do you use? On Windows the package uses librsvg-2.40.16. On other systems it depends on what is installed on your system. But I think this problem appears with the latest version as well.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

Do you have homebrew installed on your system?

UlrichRe commented 7 years ago

no, should I install homebrew?

Jeroen Ooms <notifications@github.com> schrieb am 11:42 Samstag, 3.Dezember 2016:

Do you have homebrew installed on your system?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

That way you can controll the version of librsvg yourself. So you can do:

brew install librsvg

And then in R:

install.packages("rsvg", type = "source")
UlrichRe commented 7 years ago

Thanks.I installed librsvg-2.40.16_1 and reinstalled rsvg. PDF-output is stillthe same.

Jeroen Ooms notifications@github.com schrieb am 11:52 Samstag, 3.Dezember 2016:

That way you can controll the version of librsvg yourself. So you can do:brew install librsvg And then in R:install.packages("rsvg", type = "source")— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

Note that the librsvg from brew also comes with a handy command line utility rsvg-convert. You can use this to convert the svg to png via the command line, to rule out a problem in R:

rsvg-convert svg.test.txt > out.png
UlrichRe commented 7 years ago

Is there also a way to convert directly from svg to pdf without using R?

Jeroen Ooms <notifications@github.com> schrieb am 13:13 Samstag, 3.Dezember 2016:

Note that the librsvg from brew also comes with a handy command line utility rsvg-convert. You can use this to convert the svg to png via the command line, to rule out R:rsvg-convert svg.test.txt > out.png — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jeroen commented 7 years ago

Yes, try this

rsvg-convert svg.test.txt -f pdf -o test.pdf
jeroen commented 7 years ago

I am closing this issue here because this is a problem in librsvg that also happens without R.