Skip to content

Repeating images can quickly crash browsers #99

@n8v

Description

@n8v

First, @MrRio I would like to thank you for developing jsPDF. Continually amazing, the things JS is doing! Thank you!

I'm doing a repeating a high-resolution image in my PDFs, and I quickly hit a limit. With the Octonyan image I can cause today's Chrome (Version 26.0.1410.64 m) to totally crash with "Aw, Snap!" by cranking up the number of repeated images. The crash starts for me around 40 octonyans.

// ... assuming the beginning of the octonyan addImage example
doc.text(35, 25, "Octonyan loves jsPDF");

for (var i=0; i<8; i++) {
    for (var j=0; j<6; j++) {
         doc.addImage(imgData, 'JPEG', 15+i*20, 40+j*20, 18, 18);
    }
}

I think it is in the blob handling code but it's a little hard to get at since it crashes the tab so thoroughly.

I'm going to try working around my issue by making smaller JPGs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions