Anyone working one Save flowchart as Image

468 views
Skip to first unread message

Yogesh Kadvekar

unread,
Dec 10, 2013, 3:53:51 AM12/10/13
to jsp...@googlegroups.com
Hi,

I am try to save jsPlumb flowchart as image.

if anyone already worked on this or working on this please contact me

Adriano Nogueira

unread,
Dec 12, 2013, 9:43:08 AM12/12/13
to jsp...@googlegroups.com
Tried with html2canvas, it is creating a png image but connections are not visible

Wojciech Makowiecki

unread,
Dec 12, 2013, 9:47:41 AM12/12/13
to jsp...@googlegroups.com
This would be a really great feature to have!
This question has been in the forum before, but with no good solution.

Simon, would you have any news on this topic ?


On Thu, Dec 12, 2013 at 3:43 PM, Adriano Nogueira <adriano.fil...@gmail.com> wrote:
Tried with html2canvas, it is creating a png image but connections are not visible

--
You received this message because you are subscribed to the Google Groups "jsPlumb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsplumb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Wojciech Makowiecki

unread,
Dec 12, 2013, 2:21:11 PM12/12/13
to jsp...@googlegroups.com
This looks promising (it's java), but I haven't tried it yet:

Simon Porritt

unread,
Dec 12, 2013, 2:59:39 PM12/12/13
to jsp...@googlegroups.com
The best solution I have seen is to use PhantomJS.  It's server side of course.

Wojciech Makowiecki

unread,
Dec 12, 2013, 5:17:31 PM12/12/13
to jsp...@googlegroups.com
Thank you Simon, I'll give it a try.

Simon Porritt

unread,
Dec 12, 2013, 5:27:22 PM12/12/13
to jsp...@googlegroups.com

no problem. Have some js like this in a file:

var page = require('webpage').create();
page.onCallback = function(data) {        
  page.clipRect = {top:0, left:0, width:WIDTH, height:HEIGHT}   
  page.render(OUTPUT PATH);
  phantom.exit();
};

page.viewportSize = {width:100000, height:100000}; // seems to be necessary to avoid clipping.
page.open(url);

and execute it like

phantom printer.js

of course you’ll probably want to pass the url and output in as args - they are available as system.args[...] in Phantom.

The HTML page you load should have CSS in it somehow that suppresses everything except the container inside which jsPlumb resides. does that make sense?


Yogesh Kadvekar

unread,
Jan 7, 2014, 7:30:09 AM1/7/14
to jsp...@googlegroups.com
Thanks guys !

Still struggling to save as image.

using html2canvas its not possible to get connections

I am checking alternate option

It may be good if we add function in this library which will help everyone :)

Wojciech Makowiecki

unread,
Jan 7, 2014, 7:40:14 AM1/7/14
to jsp...@googlegroups.com

Yes, this will be great! It would be even better to export to vector format like svg or pdf.

--

Yogesh Kadvekar

unread,
Jan 7, 2014, 10:41:44 AM1/7/14
to jsp...@googlegroups.com
Thanks !

I checked with PhantomJS its working perfectly on server site.

But is there any function to maintain the state or data of flowchart which is created by user run-time.

i tried jsPlumb.getInstance(); but it just instance without the actual data.

Simon Porritt

unread,
Jan 7, 2014, 2:05:01 PM1/7/14
to jsp...@googlegroups.com
jsPlumb.getInstance is for getting a new instance of jsPlumb, as documented here:



Reply all
Reply to author
Forward
0 new messages