Skip to content

[Bug]: Blob URL Error in PDF.js v4.7.76 and Above #19205

@katzura1

Description

@katzura1

Attach (recommended) or Link to PDF file

I am experiencing an error when trying to read a PDF using a Blob URL with PDF.js version 4.7.76 and above. The error message is as follows:

network.js:276 Uncaught TypeError: Failed to construct 'Headers': Invalid name
at PDFNetworkStreamFullRequestReader._onHeadersReceived (network.js:276:29)
at NetworkManager.onStateChange (network.js:119:22)

here is the error i got in version 4.7.76 and latest
image

when i using below version its work normally

image

Web browser and its version

Google Chrome

Operating system and its version

Windows 11

PDF.js version

4.7.76 above

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Load a PDF file using a Blob URL with the following code:

const blob = new Blob([/* PDF data */], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); pdfjsLib.getDocument(url).promise.then(function(pdf) { // Handle PDF loading });

  1. Observe the console for errors.

What is the expected behavior?

The PDF should load successfully without any errors.

What went wrong?

The error message appears in the console, preventing the PDF from loading.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions