Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)