Print complex SVG objects

Hi,
I tried webix.print and webix.toPNG functions and they work for all the webix objects, but when it comes down to dom elements theres'a problem with complext SVG objects.
I tried a simple one and it works:
https://snippet.webix.com/bbxpsc99

but with complex ones, I get an empty pdf or image
https://snippet.webix.com/0fts3geq

Since I noticed that dom-to-pdf library is working better than html2canvas, would it be possible to change it in webix?

I would not like to add many more libraries to handle PDFs or file save.

Thank you.

Comments

  • Hello @mabiuso ,

    The point is that html2canvas can handle properly only SVG images with the declared initial size (such images could be resized according to the applied CSS during export):

    <svg width="950" height="400" ...
    

    Please refer to the following example:
    https://snippet.webix.com/p7un2mgx

    Since I noticed that dom-to-pdf library is working better than html2canvas, would it be possible to change it in webix?

    Unfortunately not, we do not plan such changes in the near future. However, we will consider it as a suggestion for the future.

  • Dear @annazankevich ,
    thank you for your clarification.

    Unfortunately declaring the size of an svg object could lead to problems during resize. After all SVG is nice because it can adjust to any size.

    In fact, when trying to export in your example, the resulting image distorts the original chart.

    I will keep in mind your suggestion, but for the moment will try to use dom-to-image library for my function.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!