Skip to content

Instantly share code, notes, and snippets.

@davidlenz
Created April 24, 2018 15:32
Show Gist options
  • Save davidlenz/9c679c60d69e76121c677ca39e0b4336 to your computer and use it in GitHub Desktop.
Save davidlenz/9c679c60d69e76121c677ca39e0b4336 to your computer and use it in GitHub Desktop.
SVG to PDF using svglib and reportlab
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF
def svg_to_pdf(in_path, out_path):
# svg to pdf
drawing = svg2rlg(in_path)
renderPDF.drawToFile(drawing, out_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment