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

Attempt to support fetching the raw data of the PDF document from the PDFDocumentLoadingTask-instance (issue 15085) #19632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 9, 2025

The new API-functionality will allow a PDF document to be downloaded in the viewer e.g. while the PasswordPrompt is open, or in cases when document initialization failed.
Normally the raw data of the PDF document would be accessed via the PDFDocumentProxy.prototype.getData method, however in these cases the PDFDocumentProxy-instance isn't available.

Smaller diff with https://github.com/mozilla/pdf.js/pull/19632/files?w=1

Edit: I also tested this patch in a local Firefox (artifact) build, and it seems to work as intended since the PDF document can now be correctly downloaded in the situations outlined above.

… `PDFDocumentLoadingTask`-instance (issue 15085)

The new API-functionality will allow a PDF document to be downloaded in the viewer e.g. while the PasswordPrompt is open, or in cases when document initialization failed.
Normally the raw data of the PDF document would be accessed via the `PDFDocumentProxy.prototype.getData` method, however in these cases the `PDFDocumentProxy`-instance isn't available.
@mozilla mozilla deleted a comment from moz-tools-bot Mar 11, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Mar 11, 2025
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/053c9812ed03646/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/deff1ecc8ae7238/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/deff1ecc8ae7238/output.txt

Total script time: 2.39 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/053c9812ed03646/output.txt

Total script time: 7.96 mins

  • Unit Tests: Passed

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

Successfully merging this pull request may close these issues.

Saving password protected PDF file without inputting the password saves an HTML page instead
2 participants