How to use the svglib.SvgRenderer function in svglib

To help you get started, we’ve selected a few svglib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rschroll / prsannots / getannotations.py View on Github external
def svg2pdf(svg):
    renderer = svglib.SvgRenderer()
    renderer.render(svg)
    drawing = renderer.finish()
    
    pdfstring = svglib.renderPDF.drawToString(drawing)
    pdf = pyPdf.PdfFileReader(StringIO(pdfstring))
    return pdf.getPage(0)