When rendering an svg on my dev laptop (osx) I get a certain rendering, when using it on prod server based on linux ubuntu I get a really different one, despite I installed the same font set used in SVG
Guillaume Ayoub
@liZe
Oh :/. Could you please share the SVG file and the renderings?
Michele Mostarda
@michelemostarda
sure
this is the svg
Guillaume Ayoub
@liZe
Hm… It’s truncated. You can attach files with a simple drag and drop.
Hey guys, I have a query. My application is in Java. And I want to convert our SVG files to pdf. Are there any APIs exposed through which the application can connect to CairoSVG and get the file converted in realtime?
Guillaume Ayoub
@liZe
@goyaldin Hello!
The easiest solution is probably to use the command line interface.
You can even use standard input and output to avoid temporary files.
goyaldin
@goyaldin
yeah @liZe, I saw that but that needs installation on the server machine which I can't do considering the way our application is deployed on Kubernetes. I was looking more of a sort of exposed API which can be used by applications written in a different language than python. Please let me know if there is a feasible option for such a case.
Guillaume Ayoub
@liZe
@goyaldin Some people install CairoSVG in a Python web application (a simple version is ~20 lines) that gets the SVG in a request and returns the image. That’s a good solution if you don’t want to install CairoSVG in your app, but it requires you to install another app elsewhere.
goyaldin
@goyaldin
thanks, @liZe for the suggestions. I will check out what can be done here
dlwns87
@dlwns87
Hey! I have a question regarding SVG2PNG function in python. When it rasterizes the vector format SVG to a pixel formatPNG, it automatically adds anti-aliasing feature (adding grayscale). Do you know what algorithm(https://en.wikipedia.org/wiki/Spatial_anti-aliasing) it performs? is it based on the percentage of the region that covers the pixel? if not, could you explain how it's performed? Also, are there other anti-aliasing options? how do I change that? Thanks!
Guillaume Ayoub
@liZe
Hello @dlwns87!
CairoSVG handles the shape-rendering and text-rendering to set different antialiasing options