Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter wibergsweb

    (@wibergsweb)

    The same applies also when not using Visual Composer (on my local development machine)

    Plugin Author dinamiko

    (@dinamiko)

    Hi wibergsweb,

    I went able to do some tests, mPDF library (the PDF library that DK PDF uses for generating PDFs) is able to print svg format, the problem seems to be with the shortcode, I created a post here:
    https://wp.dinamiko.com/demos/dkpdf/visualizer-charts-graphs/
    the first chart (svg part added directly to the content) is printed in the PDF but not the second one ([visualizer id=”2055″]).
    Another thing that I noticed is that once you’ve added the svg part in content in Text tab and you switch to Visual Tab, all <svg>…</svg> will be lost (seems to be that the Editor is not understanding <svg>), so the thing is always stay in Text editor tab as you can see in the screenshots.

    so mPDF allows printing svg in PDF but the implementation of it is not so user friendly right now as you can see.

    Thanks.

    Thread Starter wibergsweb

    (@wibergsweb)

    Hi!

    Thanks for your time and for your reply. Using html like that WordPress usually does strip of some elements by default, so that’s understandable. This is one point of using a shortcode, then it doesn’t matter, because shortcodes are always intact even in html mode:-)

    I need to use the shortcodes because the shortcodes does fetches info directly from csv-file(s) and if I didn’t use those I could manually create all the charts without using the Visualizer Plugin. My suspicsion is that the javascript that is used for showing /hovering etc for the svg in the Visualizer Plugin is not loaded before your plugin is.

    Why do I think that? I copied the svg element on a current chart and did what you did. No active hovering without the shortcode and when I created the PDF, the values for x- and y-axis were copied down below the chart, so both the chart and the values were shown. Example: https://wibergsweb.se/visualizerchart.png

    This is of course just a theory, but I think it makes sense. Maybe you could try with a delay of 5-10 seconds before starting creating the pdf (maybe a longshort but it’s rather easy to test I believe)

    Thread Starter wibergsweb

    (@wibergsweb)

    longshot, not longshort ??

    Thread Starter wibergsweb

    (@wibergsweb)

    Is it possible that this have something to do with position of divs? I suspect there are some absolute positioning with the SVG inside, so this is maybe not a SVG issue. I know that other PDF generators seem to have a problem with absolutely positioned divs. Just a thought ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SVGS are not included in the pdf’ is closed to new replies.