How to save entire diagram as png?

Hi,
Can I save png entire diagram with high resolution?
makeImage, makeSVG can save just visible area.
When set zoomToFit() for entire diagram, then I can’t read text in wide diagram.
If use scale option, then saved image is just small part.

How to make image as entire diagram with high resolution?

thanks

If you just pass { scale: 1 } as the argument to Diagram.makeImage, don’t you get what you want?

No, it’s not.

when I use {scale:1} option as below, then I got script error.
so I use myDiagram.zoomToFit() before makeImageData.

[code]

var imgBlob = myDiagram.makeImageData({
background:‘white’,
scale:1,
type: “image/png”
});


[console]

Uncaught TypeError: Cannot call method ‘trace’ of null go.js:840
oj go.js:840
z.makeImageData.z.PH go.js:836
(anonymous function) VM283:417
f.event.handle jquery-1.6.2.min.js:16
i.handle.k


; browser IE11, Chrome 32.0.1700.76 m
; go.js 1.3.0, 1.2.9
; jquery 1.6.2

as I say before, my diagram is very large. so if I set scale to 1 then it’s hard to read text.

Here are some images.

[web page]

[1_saved_with_zoomToFit.png]

myDiagram.zoomToFit();

var imgBlob = myDiagram.makeImageData({
background:‘white’,
type: “image/png”
});


I need more clear text.

[2_saved_with_scale_1.png]
myDiagram.scale = 1;

var imgBlob = myDiagram.makeImageData({
background:‘white’,
type: “image/png”
});
scale=1, image has clear text, but only saved visible area.

[error_scale_option]

var imgBlob = myDiagram.makeImageData({
background:‘white’,
scale:1,
type: “image/png”
});




as you can see, {scale:1} option will not be answer.


I want save High Resolution Image like scale:1 and Entire diagram even invisible area.


Thanks.

Sorry about that – it’s just an exception trying to put out a warning message to the console saying that the size of the image is larger than the maxSize, which defaults to 2000x2000. You can work-around this bug by defining:

go.Debug.trace = function(x) { if (window && window.console) window.console.log(x); };

We’ll fix this in version 1.3.2.

it’s not work.

go.Debug.trace = function(x) { if (window && window.console) window.console.log(x); };
var imgBlob = myDiagram.makeImageData({
  scale: 1,
  background:'white',
  type: "image/png"
});
  1. Uncaught TypeError: Cannot set property 'trace' of null VM7314:387
    1. (anonymous function)VM7314:387
    2. f.event.handlejquery-1.6.2.min.js:16
    3. i.handle.k

let me know when released new version.
thanks.