Installing CairoSVG to convert SVG to PDF

Designers often work with vector graphics, which are images that can be resized without any loss in quality. A common format for vector graphics is SVG.

iOS supports using vector graphics directly, but only in PDF format. Thankfully, there’s an easy way to convert SVG -> PDF using a free and open source tool like cairosvg. Blogger Rex Feng wrote an excellent how-to guide to convert and use vector graphics in XCode here:

While I recommend the above link and don’t wish to repeat the information it contains, I had some issues installing cairosvg from the command line. Basically the package manager was failing to verify the dependencies’ SSL certs, leading to this error:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076) -- Some packages may not be found!

I was able to work around that error by manually installing a couple of the failing dependencies. The trick was to se flags to mark their servers as trusted. Here’s the commands I used:

pip3 install pytest-runner --trusted-host --trusted-host --trusted-host --trusted-host
pip3 install cffi --trusted-host --trusted-host --trusted-host --trusted-host
pip3 install cairosvg --trusted-host --trusted-host --trusted-host --trusted-host

Leave a Reply

Your email address will not be published. Required fields are marked *