How to print the diagram as one image

We are having a big diagram and we want to print it as one image.
Our diagram dimensions are 2500X700,
I got to know from the docs that, if the width/height is more than 2000, we have to use Infinity
I used Infinity for width, but still the image width is coming as 2000px.
below is my implementation.

var img = _diagram.makeImage({
  scale : 1,
  background : "white",
  position : new go.Point(p.x, p.y),
  size : new go.Size(Infinity, 700)

Where i’m doing wrong?

You must set maxSize to be larger.

You could try

maxSize: go.Size(Infinity, Infinity)

Though very large images may fail on some browsers.