Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
45
views
double sided mpage
Hi I can easily use mpage to condense multiple single sided sheets on a single page. However I am finding it tricky to do the same for double sided sheets. In this case I am printing badges. Say my input is Badge01Front.pdf Badge01Back.pdf Badge02Front.pdf Badge02Back.pdf Badge03Front.pdf ... How wo...
Hi I can easily use mpage to condense multiple single sided sheets on a single page. However I am finding it tricky to do the same for double sided sheets. In this case I am printing badges. Say my input is
Badge01Front.pdf
Badge01Back.pdf
Badge02Front.pdf
Badge02Back.pdf
Badge03Front.pdf
...
How would I combine multiple badges onto a single sheet, so that if I cut up the sheet into badges, I get Badge01Front on one side of the first badge and Badge01Back on the other side? (and so on). FYI, I may be using SVGs instead of PDFs, but this shouldn't change much since they are easy to convert.
I have wrote a bunch of scripts that basically do this , but they are complex and fragile. Is there a clean way of doing this?
gmatht
(121 rep)
Jan 12, 2024, 06:52 AM
• Last activity: Jan 14, 2024, 06:45 PM
1
votes
0
answers
958
views
telegram-desktop: qt.svg: Error while inflating gzip file: SVG format check failed
I use telegram-desktop on arch linux in sway. It sometimes crashes, so I started it from terminal. This way I find out telegram spams this message: > qt.svg: Error while inflating gzip file: SVG format check failed How can I fix this ?
I use telegram-desktop on arch linux in sway. It sometimes crashes, so I started it from terminal. This way I find out telegram spams this message:
> qt.svg: Error while inflating gzip file: SVG format check failed
How can I fix this ?
Jan Černý
(1723 rep)
Nov 2, 2023, 10:33 AM
0
votes
2
answers
1265
views
Merge contents of multiple svg files
I have 3 svg files that I would like to combine into a single svg file. Each file has a single path tag in it and I would like to put the path tag from each svg file into one file. I figure there is probably a way to do this with a script. At least I hope there is, I have a several hundred of the gr...
I have 3 svg files that I would like to combine into a single svg file. Each file has a single path tag in it and I would like to put the path tag from each svg file into one file. I figure there is probably a way to do this with a script. At least I hope there is, I have a several hundred of the groups of 3 files.
Trevor Orr
(119 rep)
Dec 23, 2022, 09:31 PM
• Last activity: Dec 24, 2022, 07:58 AM
1
votes
0
answers
256
views
How can I get my SVG icon to automatically change its colour depending on the background colour?
I am trying to add some icons into `~/.local/share/icons/` so that I can use them with `notify-send`. I can do that just fine, but the icon colour is not adapting to the background, unlike the Adwaita icons, and the contrast ends up being incredibly low. Note that I am able to just change the colour...
I am trying to add some icons into
And here is what my other icon looks like in a GNOME notification:
Both .svg files have the same base colour (#2e3436), but only the Adwaita one changes automatically to be legible even on a dark background. I converted my .svg file and edited it so that it resembles the Adwaita one, but I still have the same issue.
Here is what the Adwaita icon code looks like:
~/.local/share/icons/
so that I can use them with notify-send
. I can do that just fine, but the icon colour is not adapting to the background, unlike the Adwaita icons, and the contrast ends up being incredibly low.
Note that I am able to just change the colour of the icon, but this is not a viable solution, as the icon is meant to be shared with other people, who may have light themes for their notifications.
Here is what an Adwaita icon looks like in a GNOME notification:


And here is what I made the other icon into:
Silejonu
(11 rep)
Oct 28, 2022, 06:32 PM
3
votes
1
answers
3365
views
Set icon for file type, Linux Mint
I want the files with the extension **.api** to have some chosen **SVG** icon in the File Manager. Assume, we have a file: /usr/share/icons/HighContrast/scalable/apps/utilities-terminal.svg I add a new MIME type: create a **~/.mime.types** file with a line: **text/x-api api** The question is: how sh...
I want the files with the extension **.api** to have some chosen **SVG** icon in the File Manager.
Assume, we have a file: /usr/share/icons/HighContrast/scalable/apps/utilities-terminal.svg
I add a new MIME type: create a **~/.mime.types** file with a line: **text/x-api api**
The question is: how should I link the SVG file name with the MIME type?
NOTE: No need of creating the custom icon, no need to launch some application by double-clicking. This question deals only with the linking of the given icon to file extension.
darkSideOfTheMoon
(135 rep)
Sep 10, 2018, 05:10 AM
• Last activity: Oct 5, 2022, 12:08 AM
0
votes
1
answers
199
views
How to remove only links, but not actual files?
I have a folder full of .svg files, some of which are actual files and others are merely links to files. They both have the .svg file extension, however the actual files are labeled "SVG Image" and the links are labeled "Link to SVG Image". I only want to delete the links, but I can't rm *.svg becau...
I have a folder full of .svg files, some of which are actual files and others are merely links to files. They both have the .svg file extension, however the actual files are labeled "SVG Image" and the links are labeled "Link to SVG Image". I only want to delete the links, but I can't rm *.svg because they both have the file extension .svg.
I can do
ls
and it shows the actual files vs symlinks in different colors so there is definitely a distinction. There are also far too many files to sort manually, which is why I want to be able to do this via a terminal command.
Jeff Chen
(133 rep)
Dec 14, 2021, 03:16 AM
• Last activity: Dec 14, 2021, 01:58 PM
3
votes
3
answers
7119
views
How to view a big svg file?
I have a big SVG file (~200MB): it's a graph with very precise data. However when gzipped into graph.svgz its size is around 3 MB, so you see it's very repetitive data. When I attempt to open it, Inkscape hangs and fills up the RAM, the only exit is reboot [REISUB][1]. I use Debian 10 with KDE deskt...
I have a big SVG file (~200MB): it's a graph with very precise data. However when gzipped into graph.svgz its size is around 3 MB, so you see it's very repetitive data.
When I attempt to open it, Inkscape hangs and fills up the RAM, the only exit is reboot REISUB .
I use Debian 10 with KDE desktop.
Any idea to view the image ? It's OK to use another tool than inkscape, but I need to view the chart in detail, so generating a postage-stamp-sized PNG is not a good solution.
color2v
(163 rep)
May 20, 2020, 05:44 PM
• Last activity: Apr 19, 2021, 07:54 PM
7
votes
4
answers
4773
views
Are there any multiformat image viewers, which are similar to feh and can show SVG files?
At the moment I'm working with a lot of SVG files and I don't have a good tool to inspect this files. Normally I use `feh` to take a look at an image, but `feh` can't show SVG files. Now I'm looking for a replacement. The replacement should have all the features of `feh` and should be able to open S...
At the moment I'm working with a lot of SVG files and I don't have a good tool to inspect this files.
Normally I use
feh
to take a look at an image, but feh
can't show SVG files.
Now I'm looking for a replacement. The replacement should have all the features of feh
and should be able to open SVG files.
Especially the following features are mandatory
- simple feh
like GUI
- the tool should be designed for the use in a shell
- $command ~/image1.svg image2.jpg
should only open these two files not the directory ~/
- support multiple image formats
- small memory footprint and not to many dependencies
I know the Eye of GNOME (eog
) does all this, but it is a GNOME tool and as such it needs to many GNOME dependencies.
Raphael Ahrens
(9871 rep)
Sep 25, 2013, 06:57 AM
• Last activity: Mar 8, 2021, 04:38 PM
16
votes
5
answers
19489
views
How to batch convert bitmaps to SVGs?
I have many gray scale bitmaps that I need to convert to a vector format, such as SVG. I have been using Inkscape, which gives nice results, but this takes about 10-15 minutes to open, convert, and save a file. Is there a batch or command line tool that can convert these?
I have many gray scale bitmaps that I need to convert to a vector format, such as SVG. I have been using Inkscape, which gives nice results, but this takes about 10-15 minutes to open, convert, and save a file. Is there a batch or command line tool that can convert these?
Village
(4177 rep)
Jan 25, 2014, 12:46 AM
• Last activity: Aug 27, 2020, 02:19 PM
0
votes
1
answers
539
views
Replace an attribute value with another value in SVG
I have a directory that contains multiple SVG files. What I am trying to do is replace the `height="2500"` (value of height can be any integer) with `height="{{ include.height }}"`. Can anyone tell me what I am doing wrong? ```svg ``` ```bash find_string="height=\"\d+\"" replace_string="height=\"{{...
I have a directory that contains multiple SVG files. What I am trying to do is replace the
height="2500"
(value of height can be any integer) with height="{{ include.height }}"
. Can anyone tell me what I am doing wrong?
find_string="height=\"\d+\""
replace_string="height=\"{{ include.height }}\""
for i in . -type f -name "*.svg");
do
if grep -q "${find_string}" $i
then
sed -i -r "s/${find_string}/${replace_string}/" $i
fi
done
Ravgeet
(1 rep)
Jun 29, 2020, 10:06 AM
• Last activity: Jun 30, 2020, 12:42 PM
3
votes
1
answers
837
views
Debugging a slow thumbnailer process
I am trying a debug a peculiar performance behavior in the thumbnail-generating process for [`eog`](https://wiki.gnome.org/Apps/EyeOfGnome), specifically [`gdk-pixbuf`](https://developer.gnome.org/gdk-pixbuf/). The minimal files to reproduce are here: https://github.com/nbeaver/gdk-pixbuf-bug The pr...
I am trying a debug a peculiar performance behavior
in the thumbnail-generating process for [
eog
](https://wiki.gnome.org/Apps/EyeOfGnome) ,
specifically [gdk-pixbuf
](https://developer.gnome.org/gdk-pixbuf/) .
The minimal files to reproduce are here:
https://github.com/nbeaver/gdk-pixbuf-bug
The process tree looks like this:
systemd,1 splash
`-plasmashell,4366
`-konsole,6783
`-bash,6793
`-make,6949 reproduce
`-eog,6973 /usr/share/doc/docutils-doc/docs/user/images
`-bwrap,10071 --ro-bind /usr /usr --ro-bind /bin /bin --ro-bind /lib64 /lib64 --ro-bind /lib /lib --ro-bind /sbin /sbin --proc /proc --dev /dev --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --bind /tmp/gnome-desktop-thumbnailer-2HUN5Z /tmp --ro-bind /usr/share/doc/docutils-doc/docs/user/images/s5-files.svg /tmp/gnome-desktop-file-to-thumbnail.svg --seccomp 11 /usr/bin/gdk-pixbuf-thumbnailer -s 128 file:///tmp/gnome-desktop-file-to-thumbnail.svg /tmp/gnome-desktop-thumbnailer.png
`-bwrap,10074 --ro-bind /usr /usr --ro-bind /bin /bin --ro-bind /lib64 /lib64 --ro-bind /lib /lib --ro-bind /sbin /sbin --proc /proc --dev /dev --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --bind /tmp/gnome-desktop-thumbnailer-2HUN5Z /tmp --ro-bind /usr/share/doc/docutils-doc/docs/user/images/s5-files.svg /tmp/gnome-desktop-file-to-thumbnail.svg --seccomp 11 /usr/bin/gdk-pixbuf-thumbnailer -s 128 file:///tmp/gnome-desktop-file-to-thumbnail.svg /tmp/gnome-desktop-thumbnailer.png
`-gdk-pixbuf-thum,10075 -s 128 file:///tmp/gnome-desktop-file-to-thumbnail.svg /tmp/gnome-desktop-thumbnailer.png
From the [strace
log](https://github.com/nbeaver/gdk-pixbuf-bug/blob/master/strace_1564026245.log) ,
it looks like /usr/bin/gdk-pixbuf-thumbnailer
is spending about 30 seconds
looking at font files:
22:44:05 munmap(0x7fd491988000, 20930832) = 0
22:44:05 openat(AT_FDCWD, "/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc", O_RDONLY) = 5
22:44:05 fcntl(5, F_SETFD, FD_CLOEXEC) = 0
22:44:05 fstat(5, {st_mode=S_IFREG|0644, st_size=20930832, ...}) = 0
22:44:05 mmap(NULL, 20930832, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fd491988000
22:44:05 close(5) = 0
22:44:06 munmap(0x7fd491988000, 20930832) = 0
22:44:06 openat(AT_FDCWD, "/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc", O_RDONLY) = 5
22:44:06 fcntl(5, F_SETFD, FD_CLOEXEC) = 0
22:44:06 fstat(5, {st_mode=S_IFREG|0644, st_size=20930832, ...}) = 0
22:44:06 mmap(NULL, 20930832, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fd491988000
22:44:06 close(5) = 0
22:44:31 stat("/usr/share/fonts/opentype/stix-word/STIXMath-Regular.otf", {st_mode=S_IFREG|0644, st_size=476872, ...}) = 0
22:44:31 openat(AT_FDCWD, "/usr/share/fonts/opentype/stix-word/STIXMath-Regular.otf", O_RDONLY) = 5
22:44:31 fcntl(5, F_SETFD, FD_CLOEXEC) = 0
22:44:31 fstat(5, {st_mode=S_IFREG|0644, st_size=476872, ...}) = 0
22:44:31 mmap(NULL, 476872, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fd49c26a000
22:44:31 close(5) = 0
There is a particular SVG that triggers this behavior.
However, it's not enough to just run eog
or gdk-pixbuf-thumbnailer
on the SVG.
This behavior only happens when:
- running eog
on a directory;
- there is a particular SVG in the directory
that does not already have a thumbnail in ~/.cache/thumbnails/
.
(I use touch
to update the timestamp of the SVG
and make the thumbnailer run again every time.)
- there is at least one other image in the same directory;
- and the other image has a filename that collates *before* the SVG filename.
(If the filename collates *after* the SVG filename,
it generates the thumbnail in less than a second.
Otherwise it takes around 30 seconds.)
There are some other puzzles, too.
In the [strace
log](https://github.com/nbeaver/gdk-pixbuf-bug/blob/master/strace_1564026245.log) ,
the wall clock times don't seem to match the time spent in the system calls.
I've run eog
under strace
with the -f
flag:
> -f
>
> Trace child processes as they are created by currently traced processes as
> a result of the fork(2), vfork(2) and clone(2) system calls.
and I've also tried the -ff
flag:
> -ff
>
> If the -o filename
option is in effect, each processes trace is written
> to filename.pid
where pid
is the numeric process id of each process.
but in either case
gdk-pixbuf-thumbnailer
doesn't show up in the logfiles of child processes.
I'm also having trouble running gdb
on gdk-pixbuf-thumbnailer
(something about "Target and debugger are in different PID namespaces"),
so I can't tell where it's getting stuck.
$ sudo gdb -p 20789
[sudo] password for nathaniel:
Error while mapping shared library sections:
Could not open `target:/lib/x86_64-linux-gnu/libbsd.so.0' as an executable file: No such file or directory
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable. Connect to gdbserver inside the container.
(gdb) quit
Detaching from program: target:/newroot/usr/bin/gdk-pixbuf-thumbnailer, process 20789
I'm guessing this has to do with the bwrap
container.
Version information:
$ apt-cache policy libgdk-pixbuf2.0-bin eog
libgdk-pixbuf2.0-bin:
Installed: 2.36.11-2
Candidate: 2.36.11-2
Version table:
*** 2.36.11-2 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
eog:
Installed: 3.28.1-1
Candidate: 3.28.1-1
Version table:
*** 3.28.1-1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
My questions are:
- Is this bug reproducible on other machines and other versions?
(I happen to be using Ubuntu 18.04,
but I want to know if this happens on other distributions.)
- Why isn't strace -f
picking up /usr/bin/gdk-pixbuf-thumbnailer
as a child process of eog
?
Does eog
use an unusual method to create child processes?
- How can I use gdb
to attach to the
/usr/bin/gdk-pixbuf-thumbnailer
process
and see what function it's spending time in?
- What might be causing this behavior?
Nathaniel M. Beaver
(1398 rep)
Jul 25, 2019, 04:05 AM
• Last activity: Jul 25, 2019, 05:05 PM
1
votes
1
answers
464
views
Using sed to replace the hexadecimal code for URL and to insert new SVG codes after SVG tag in all SVG files
I would like to ... * replace the hexadecimal code for URL (id) in all SVG files * insert/add the new lines of SVG codes after ` `, using Regex. Input: Output: Here is my shell script: for i in *.svg; do sed --in-place --follow-symlinks 's/#5c616c/url(#grad1)/' "$i" done; for i in *.svg; do sed --in...
I would like to ...
* replace the hexadecimal code for URL (id) in all SVG files
* insert/add the new lines of SVG codes after ``, using Regex.
Input:
Output:
Here is my shell script:
for i in *.svg;
do sed --in-place --follow-symlinks 's/#5c616c/url(#grad1)/' "$i"
done;
for i in *.svg;
do sed --in-place --follow-symlinks '/(svg)([^]*)/ag ' "$i"
done;
In one line:
for i in *.svg; do sed --in-place --follow-symlinks 's/#5c616c/url(#grad1)/g; /(svg)([^]*)/a ' "$i"; done
My commands are not good, because it replaced and inserted some SVG files, and destroyed others.
Based:
* https://unix.stackexchange.com/questions/121161/how-to-insert-text-after-a-certain-string-in-a-file
* [How to replace multiple patterns at once with sed?](https://stackoverflow.com/questions/26568952/how-to-replace-multiple-patterns-at-once-with-sed)
## Updated
Based on:
* https://unix.stackexchange.com/questions/265797/renaming-files-and-directories-recursively-using-rename-find
* [Find and replace files in multiple folders](https://www.unix.com/shell-programming-and-scripting/43398-find-replace-files-multiple-folders.html)
I have an icons theme called Breeze. Firstly I want to find that an icons theme is in
/usr/share/icons/breeze
, /home/$USER/.icons/breeze
or /home/$USER/.local/share/icons/breeze
, and if it is found, I will cd
it and then replace and insert in all SVG files in multiples folders (not all folders). Three folders: apps/16
, mimetypes/16
and places/16
.
Is it possible to re-adapt with these codes derived of links in the file replace-all.sh
?
Oo'-
(255 rep)
Jan 5, 2019, 10:43 PM
• Last activity: Jan 6, 2019, 03:32 AM
2
votes
1
answers
773
views
Configuring Apache to read svgz file type
I recently migrated a site to a new server. I'm now getting this error from Firefox when attempting to load an .svgz file: XML Parsing Error: not well-formed The svg rendered fine on the old server, so I'm assuming this is a problem with the Apache configuration. I've tried adding the following to t...
I recently migrated a site to a new server. I'm now getting this error from Firefox when attempting to load an .svgz file:
XML Parsing Error: not well-formed
The svg rendered fine on the old server, so I'm assuming this is a problem with the Apache configuration. I've tried adding the following to the .htaccess file for the site:
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE image/svg+xml
# Or, compress certain file types by extension:
SetOutputFilter DEFLATE
SetOutputFilter DEFLATE
and:
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
Neither seem to work . Any ideas how to get the SVG to load?
symlink
(221 rep)
Feb 19, 2017, 10:41 PM
• Last activity: Jun 27, 2018, 10:02 AM
0
votes
1
answers
236
views
Automatic conversion of Inkscape <=0.91 files to the new 0.92 CSS format
Inkscape 0.92 asks the user if old files should be converted to match [the new resolution][1]. [![Selection pop up][2]][2] I aligned all old pictures in units of millimetre. How can I convert all old files with a script? Is there an inkscape argument I can use for a commandline like find -name "*.sv...
Inkscape 0.92 asks the user if old files should be converted to match the new resolution .
I aligned all old pictures in units of millimetre.
How can I convert all old files with a script?
Is there an inkscape argument I can use for a commandline like
find -name "*.svg" | xargs inkscape ...

Jonas Stein
(4298 rep)
Aug 1, 2017, 11:28 PM
• Last activity: Aug 2, 2017, 04:08 PM
5
votes
1
answers
5719
views
limitations of CUPS command line printing of image files
I have my default printer set: `lpoptions -d HP_ENVY_5530_series`. I can print some text: echo HELLO > h.txt lp h.txt > [CUPS understands many different types of files directly, including text, PostScript, PDF, and image files.](http://www.cups.org/documentation.php/options.html) I can print a Porta...
I have my default printer set:
lpoptions -d HP_ENVY_5530_series
.
I can print some text:
echo HELLO > h.txt
lp h.txt
> [CUPS understands many different types of files directly, including text, PostScript, PDF, and image files.](http://www.cups.org/documentation.php/options.html)
I can print a Portable Network Graphics: lp Gnome2.26-printing-dialogue.png
.
A Scalable Vector Graphics: lp Cups_simple.svg
- prints as its internal text contents, which isn't much use.
A scanned JPEG: lp 022.jpg
- gets stopped "Unable to open image file for printing!". If I convert it to a PNG with ImageMagick - convert 022.jpg 022.png
, I can then print it lp 022.png
.
I would like an explanation for these limitations of the CUPS lp
command.
joharr
(164 rep)
Dec 26, 2015, 09:11 PM
• Last activity: Dec 26, 2015, 11:48 PM
10
votes
1
answers
6341
views
Crop SVG drawing to canvas size in command line
I have SVG images produced by PlantUML, which has some parts of drawing outside of canvas. It makes it difficult to use such images and I need to crop drawing to canvas size. As I produce UML diagrams with script anyways, it would be really efficient to perform a cropping there as well. So far I've...
I have SVG images produced by PlantUML, which has some parts of drawing outside of canvas. It makes it difficult to use such images and I need to crop drawing to canvas size. As I produce UML diagrams with script anyways, it would be really efficient to perform a cropping there as well.
So far I've tried two things:
a) resize canvas to drawing with Inkscape
inkscape --verb=FitCanvasToDrawing --verb=FileSave --verb=FileClose *.svg
This works fine, but I need to crop drawing to canvas size and this operation seems to be unavailable.
b) resize with rsvg-convert
rsvg-convert image.svg -w 1870 -h 1195 -f svg -o image.svg
This does exactly croping to the desired size, but image size increases ~10 times as now there are some binary images embedded into SVG. This is not acceptable for me.
divanov
(251 rep)
May 7, 2014, 12:45 PM
• Last activity: Dec 3, 2015, 11:08 AM
2
votes
4
answers
1814
views
Modify an SVG file based on information in a CSV file
I've got a SVG file of the map of the US and I want to add colors to it. Because it would take me to much time, I thought I could use a bash script. I have also another file containing the states and the colors that belong to them. SVG-file: Hawaii CSV-file HI, blue What I want: Hawaii I thought I c...
I've got a SVG file of the map of the US and I want to add colors to it. Because it would take me to much time, I thought I could use a bash script. I have also another file containing the states and the colors that belong to them.
SVG-file:
Hawaii
CSV-file
HI, blue
What I want:
Hawaii
I thought I could use
grep
or sed
but I really don't know where to begin.
M-Reda Daoudi
(145 rep)
Nov 29, 2015, 08:28 PM
• Last activity: Nov 30, 2015, 07:38 AM
1
votes
0
answers
156
views
Can gedit highlight element of svg stucture?
Gedit can show matching parenthesis. Can it do the same with tags of an SVG file ? For example when I mark ` ` I need to find closing ` ` tag.
Gedit can show matching parenthesis. Can it do the same with tags of an SVG file ?
For example when I mark `
I need to find closing
` tag.
Adam
(1019 rep)
Nov 30, 2014, 09:21 AM
• Last activity: Dec 4, 2014, 06:03 PM
0
votes
1
answers
2740
views
Convert SVG to PDF in python
I am trying to convert an SVG file to PDF in python using the `svglib` and `reportlab` packages. Here is the SVG file. Here is the code I am using to convert (got this from `svglib` webpage). >>> from svglib.svglib import svg2rlg >>> from reportlab.graphics import renderPDF >>> drawing = svg2rlg("fi...
I am trying to convert an SVG file to PDF in python using the
svglib
and reportlab
packages. Here is the SVG file.
Here is the code I am using to convert (got this from svglib
webpage).
>>> from svglib.svglib import svg2rlg
>>> from reportlab.graphics import renderPDF
>>> drawing = svg2rlg("file.svg")
>>> renderPDF.drawToFile(drawing, "file.pdf")
The code runs fine without any error or exception but the file.pdf
thus generated is a blank file. I mean that when I open this PDF file I see nothing but only white background page with nothing on it.
Where am I going wrong ?
g4ur4v
(1864 rep)
May 15, 2013, 01:23 PM
• Last activity: May 15, 2013, 02:34 PM
3
votes
1
answers
593
views
Icon themes, when is svg format helpful?
I found that arch provides both `oxygen-icons` and `oxygen-icons-svg`, what's the necessity of svg format? Is there something that a PNG image "can't do", maybe performance issue? Not sure about it.
I found that arch provides both
oxygen-icons
and oxygen-icons-svg
, what's the necessity of svg format? Is there something that a PNG image "can't do", maybe performance issue?
Not sure about it.
daisy
(55777 rep)
Nov 24, 2012, 03:30 PM
• Last activity: Nov 24, 2012, 03:35 PM
Showing page 1 of 20 total questions