Skip to content

Max 1GB PDF output size re 1GB nodejs buffer limit #778

@jakeg

Description

@jakeg

We're creating PDFs with node-canvas and I've found the following error when generating particularly large files:

FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length exceeds max acceptable value
Aborted (core dumped)

I think this is because the PDF buffer generated from canvas.toBuffer() exceeds 1GB as per:
http://stackoverflow.com/questions/8974375/whats-the-maximum-size-of-a-node-js-buffer

This seems quite likely, as it's a 120 page PDF with multiple high-resolution images in it!

If this is the problem, is there a way to stream the PDF output instead, increase node's 1GB limit, or any other potential solutions?

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