Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

How to print large image

$
0
0

@Richard wrote:

generatePDF() {
// var myDiagram: go.Diagram;
// sanitize input
var width = this.diagrams.documentBounds.width;
var height = this.diagrams.documentBounds.height;
console.log(width);
console.log(height);

    if (isNaN(width)) width = 100;
    if (isNaN(height)) height = 100;
    // Give a minimum size of 50x50
    width = Math.max(width, 50);
    height = Math.max(height, 50);
    var imgDiv = document.getElementById('myImages');
    console.log(imgDiv)
    // imgDiv.innerHTML = ''; // clear out the old images, if any
    var db = this.diagrams.documentBounds.copy();
    var boundswidth = db.width;
    var boundsheight = db.height;
    var imgWidth = width;
    var imgHeight = height;
    var p = db.position.copy();
    //making images
    for (var i = 0; i < boundsheight; i += imgHeight) {
        var img: any
        for (var j = 0; j < boundswidth; j += imgWidth) {
            img = this.diagrams.makeImage({
                scale: 0.5,
                type: "image/png",
                background: "white",
                position: new go.Point(p.x + j, p.y + i),
                maxSize: new go.Size(Infinity, Infinity)
            });
        }
    }

I am creating the image in width was 12000 and Height was 7000 , while creating large image my chrome Browser was hanging, Then image also not creating .But in the case i can create a small image ,its was working properly like width was 3000 height was 1000,i am followed this link as per given sample. https://gojs.net/latest/intro/printing.html,If you Dont Mind could you tell me,
How to get print the large images for printing,Thanks Advance.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles