• Resolved neocreo

    (@neocreo)


    OK boys and girls. I really love this plugin, and use it in a project of mine. however, I have run into problems after an update, where the PDF no longer renders SVG-images I have in my code. Now, when I say SVG-images, I mean <svg>-tags – not <img>-tags. Instead of just the rendered graphic, I end up with just any plain text inside the graphic.
    Of course in the preview, everything is dandy, so something must be happening when it renders into PDF.

    I think the problem lies in the dompdf, but really I can use any help you guys can give.

    Anyone else run into this, or know how to update DOMPDF to enhance the support for SVG?

    https://wordpress.org/plugins/wp-pdf-templates/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter neocreo

    (@neocreo)

    No ideas about this?

    Plugin Author Viljami Kuosmanen

    (@zuige)

    DOMPDF doesn’t support SVG as far as i know. Sorry. Nothing we can do here 🙁

    Thread Starter neocreo

    (@neocreo)

    Hey Antti, yeah, been reading myself in on this. Can’t wait until they release their new version though. It apparently will have svg support.

    As a work around though, I was wondering if it is possible to maybe render the SVG and convert it via javascript to a PNG? I am working with data-uri, and not physical files.

    Or would I have to render the files on the server, as I have a feeling dompdf won’t run javascript.

    What do you think, as a stab in the dark?

    Plugin Author Viljami Kuosmanen

    (@zuige)

    Javascript won’t work. You would need to pre-render the svg to a png file on the server side.

    Feel free to implement it as a filter to this plugin and give me a PR on GitHub. 🙂

    Hope we’ll get a better DomPDF soon

    Thread Starter neocreo

    (@neocreo)

    Ignore that previous message, yup, will have to find a way to render the svg as a PNG file on the server side. Hope you don’t mind if I post my findings here for reference?

    Plugin Author Viljami Kuosmanen

    (@zuige)

    Of course! Thanks for your input. Feel free to post any tips and tricks below

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘SVG tags are not rendered’ is closed to new replies.