Questions tagged [librsvg]

librsvg is a library to render SVG files using cairo.

librsvg is a library to render SVG files using cairo. Additionally, using various tools you can create and manipulate SVG objects.

67 questions
2
votes
1 answer

Extending librsvg vapi

The vapi file that is available for librsvg-2.0 contains a lot less than what the actual library contains vapi: http://valadoc.org/#!wiki=librsvg-2.0/index library: https://git.gnome.org/browse/librsvg/tree/ I would have expected to have access to…
2
votes
1 answer

Open and edit SVG files using C/C++

I'm developping an editor that must use SVG shapes to create diagrams. To open and display SVGs I use librsvg which is actually pretty good but only useful to render SVGs not to edit them. I would like to access to shape's property and change their…
A.G.
  • 1,279
  • 1
  • 11
  • 28
2
votes
1 answer

How do I save a jpg from a cairo

Below is the code I am using to save a png from a svg file. That works, but I also need to save it as a jpeg. Can someone advise me on how to do this? private void RasterizeSvg(string tempsvg, string rsltPath, int _width, int _height) { …
edepperson
  • 1,035
  • 1
  • 14
  • 33
1
vote
0 answers

Unable to install rsvg package at Ubuntu 22.04 with librsvg2-dev already installed

I am getting the following error at an Ubuntu 22.04, when trying to install rsvg at Rstudio. --------------------------- [ANTICONF] -------------------------------- Configuration failed to find the librsvg-2.0 library. Try installing: deb:…
hamagust
  • 728
  • 2
  • 10
  • 28
1
vote
1 answer

How to crop a SVG image to the bounding box of the vector grafics elements

I have a SVG image here which is generated with 'empty space', i.e. only in the top-left corner is image content, whereas the rest is blank. I think it should be trivially possible to have an automated way to crop the image size to the bounding box…
wirrbel
  • 3,173
  • 3
  • 26
  • 49
1
vote
1 answer

Differences while rendering SVG with librsvg and Python

Depending upon rendering an SVG either as a whole document or as a single element shows differences in rendering. I created a simple SVG graphic using Inkscape and want to render it using Python. I decided librsvg was the way to go. This is my SVG,…
MasinAD
  • 31
  • 6
1
vote
0 answers

Can't load svg with base64 image inside with node-canvas

I have an issue when load svg ( with base64 image inside ) file using function loadImage I get exception: GdkPixbuf-CRITICAL **: 13:03:49.842: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed Here is my code & test svg file: const…
Tho Bui Ngoc
  • 763
  • 1
  • 11
  • 36
1
vote
0 answers

How to use python-rsvg in ubuntu 18?

In ubuntu 18 python-rsvg is not available as a package. I need to render an svg to a pyCairo context, basically: handle = rsvg.Handle(path_to_svg_file) handle.render_cairo(context) Is there an alternative python binding for rsvg, or a different way…
morgen
  • 11
  • 1
1
vote
0 answers

How to use the Rsvg.Handle.has_sub function?

I want use the librsvg to render part of some svg files. When I use those code: try { handle = new Rsvg.Handle.from_file(inputtext); } catch (GLib.Error e) {error ("%s", e.message);} if(handle.has_sub("##sub0") &&…
eexpress
  • 386
  • 1
  • 14
1
vote
1 answer

cairo + librsvg: draw svg icons forcing the colour at runtime

I'm using a set of svg icons in my applications, and I'm painting them using librsvg. These icons are all single-colour black drawings, and I can only draw them black because that is the colour written in the svg file. There is a way I can to…
user6369958
  • 357
  • 3
  • 16
1
vote
2 answers

How to get rsvg to assume 96 dpi for SVG?

When I use rsvg-convert.exe -f pdf -o .pdf .svg I get a result that differs from how the SVG is rendered in Inkscape and Firefox. This is a simple test SVG:
Daniel
  • 3,383
  • 4
  • 30
  • 61
1
vote
2 answers

Imagick converting SVG via rsvg renders image blank from PHP, but ok from command line

I've read a range of Questions and web articles but seem to be up against a brick wall. I have reduced my problem to a very simple SVG file, containing a single image. When converted from PHP via imagick, the image is rendered blank, but from the…
Neek
  • 7,181
  • 3
  • 37
  • 47
1
vote
1 answer

Base64 jpg to base64 Png in Ruby

I'm working with base64 files and i would like to convert a base64jpg image in a base64png image. Is there a way to do it? The reason is i'm using rsvg-convert to convert svg files into png files, but when i have a base64jpg in my svg, it's not…
Lucas Juarez
  • 137
  • 2
  • 11
1
vote
3 answers

How to get high-res thumbnails out of low-res SVGs in Mediawiki?

I don't exactly know how to word this question properly, so I'll make an attempt: See the rasterized SVG on this page? Looks pretty distorted, and - excuse me language - rather s***. Now let's compare it with the one here. Both of them have the…
1
vote
1 answer

scaling svg figure

I tried to resize svg file to be opened in illustrator with smaller width and height(pixels or cm), I did this by changing width, height and viewBox attributes in tag, but it doesn't work at all. By search I have found that transform attribute…
loll
  • 241
  • 3
  • 6
  • 14