Cario SVG to PDF

I was looking for an html to pdf converter that did SVG. So I decided to look for SVG to PDF converter and I ran across . The end goal is to get UTF8 text and vector drawings into PDF

Since Openfl next is using Cairo to render, how hard would it be to make it render to PDF? Any idea?

I don’t think we could use this directly, it uses Python, but since we have Cairo and an SVG library (which could still improve, but we have one) we have SVG to PNG/JPG conversion already. We could take this another step and generate a PDF from those images? I remember using a library with AS3 before for PDF generation

It looks like Cairo could do it. See second example

Do you think it would be hard to hook into it?

Oh, interesting!

Alright, so to enable this, I assume we would need (potentially) more files compiled to support PDF support. Here is the file list (currently):

We would also need to tweak the config header for each platform to include the PDF surface define, or anything else we want:

Then I assume we would do something like this:

…but CairoPDFSurface instead of CairoImageSurface

The bindings to Cairo live here: