Skip to main content

Svglib is an experimental library for reading SVG files and converting them (to a reasonable degree) to other formats using the Open Source ReportLab Toolkit. As a package it reads existing SVG files and returns them converted to ReportLab Drawing objects that can be used in a variety of ReportLab-related contexts, e.g. as Platypus Flowable objects or in RML2PDF. As a command-line tool it converts SVG files into PDF ones.

Tests include a vast amount of tests from the W3C SVG test suite.

This release accesses 199 flags from Wikipedia.org for test purposes.

Features

  • convert SVG files into ReportLab Graphics Drawing objects

  • handle plain or compressed SVG files (.svg and .svgz)

  • allow patterns for output files on command-line

  • install a Python package named svglib

  • install a Python command-line script named svg2pdf

  • provide a Unittest test suite

  • test on some standard W3C SVG tests available online

  • test on some Wikipedia sample SVG symbols available online

  • test on some Wikipedia sample SVG flags available online

Examples

You can use svglib as a Python package e.g. like in the following interactive Python session:

>>> from svglib.svglib import svg2rlg
>>> from reportlab.graphics import renderPDF
>>>
>>> drawing = svg2rlg("file.svg")
>>> renderPDF.drawToFile(drawing, "file.pdf")

In addition a script named svg2pdf can be used more easily from the system command-line like this (you can see more examples when typing svg2pdf -h):

$ svg2pdf file1.svg file2.svgz
$ svg2pdf -o "%(basename)s.pdf" /path/file[12].svgz?

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svglib-0.6.1.tar.gz (551.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

svglib-0.6.1-py2.6.egg (27.5 kB view details)

Uploaded Egg

svglib-0.6.1-py2.5.egg (27.6 kB view details)

Uploaded Egg

File details

Details for the file svglib-0.6.1.tar.gz.

File metadata

  • Download URL: svglib-0.6.1.tar.gz
  • Upload date:
  • Size: 551.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svglib-0.6.1.tar.gz
Algorithm Hash digest
SHA256 cc8e505c8467b689a999ea6885796144731bca1c0810d3c464c5553cef32d275
MD5 a387fc691e700b76dc1d706ac900ac81
BLAKE2b-256 b4a0ad5cb024eb59957a361759bab77a2c12bed00735294e4c23487493339474

See more details on using hashes here.

File details

Details for the file svglib-0.6.1-py2.6.egg.

File metadata

  • Download URL: svglib-0.6.1-py2.6.egg
  • Upload date:
  • Size: 27.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svglib-0.6.1-py2.6.egg
Algorithm Hash digest
SHA256 51c99478bb58b55d5a94c99f9d1131870007f4750415154aef7ada42471c0ede
MD5 fd5a97d7b1f536c4bc75f591925f6bfb
BLAKE2b-256 a9b56121f0f3d8bed1b1504f86272fc2f528417be7bc86a008fd7f4ead023273

See more details on using hashes here.

File details

Details for the file svglib-0.6.1-py2.5.egg.

File metadata

  • Download URL: svglib-0.6.1-py2.5.egg
  • Upload date:
  • Size: 27.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svglib-0.6.1-py2.5.egg
Algorithm Hash digest
SHA256 2bc15624410f17c173807063f1355ce8833124f8a724fd8c8e170f84e44c8439
MD5 013a70cefeec7e547c0cf5700a2649bb
BLAKE2b-256 dc63085fc022abdb16df59501f813f7f9cf0f015751b08d2045d4e7233c6f915

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page