Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The argument 'path' must be a string or Uint8Array without null bytes #135

Open
rodpf opened this issue Feb 14, 2024 · 0 comments
Open

The argument 'path' must be a string or Uint8Array without null bytes #135

rodpf opened this issue Feb 14, 2024 · 0 comments

Comments

@rodpf
Copy link

rodpf commented Feb 14, 2024

Hi,

Since I need support for ES5, I am using V4.3.1.

I am passing a ByteArray and receiving the following error:

The argument 'path' must be a string or Uint8Array without null bytes. Received Uint8Array(95657)

This is the snippet for creating the stream:

        const file = await _getObjectStream(null)

        const merger = new PDFMerger();
        for (let i=0 ; i<1000; i++)
        {
            await merger.add (file)
        }
        const mergedPdfBuffer = await merger.saveAsBuffer();

The error occurs on await merger.add (file)

As you can see I am receiving the file as a Uint8Array and trying to merge the same content a few times to execute a stress test and limit the size of the merged file.

The value for 'file' is valid, since I can see and download the content from the same variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant