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 http://cairosvg.org/ . 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

http://zetcode.com/gfx/cairo/cairobackends/

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):

https://github.com/native-toolkit/cairo/blob/master/files.xml

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

https://github.com/native-toolkit/cairo/tree/master/include/configs

Then I assume we would do something like this:

https://github.com/openfl/lime/blob/master/lime/graphics/cairo/CairoImageSurface.hx

…but CairoPDFSurface instead of CairoImageSurface

The bindings to Cairo live here:

https://github.com/openfl/lime/blob/master/project/src/graphics/cairo/CairoBindings.cpp