Open PMunch opened 6 months ago
You need to write your own SVG renderer. Adding it to PDF is beyond the scope of a PDF writer. you can see the example of converting SVG to vector graphics primitives here: https://github.com/jangko/nimAGG/blob/devel/examples/svg_path_renderer.nim it should be similar when using PDF api.
Hmm, fair enough. But what about converting the SVGs to PDF first, and then laying out the smaller PDFs in a larger one using this library?
scale, move, rotate, stretch, skew, and setTransform + saveState and restoreState should work. You do the transformation on the fly, not after converting to PDF. This is not a PDF reader library.
I've been using this to create some PDFs for notebooks where I design the individual pages through a combination of scripts and manual SVG work. I then convert all my pages to PNG and have a script witch stitches them together as a PDF. However that requires me to select the DPI of the images when I convert them, it would be much better to add the vector graphics directly to the PDF. Would it be possible to add SVG support, or alternatively PDF-as-images support so I can convert my SVGs to PDFs and then lay them out with this?