Skip to content

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

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

Merged
merged 1 commit into from
Mar 16, 2025

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.

@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/3e05f4394abea18/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/2582765eefbdb56/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/2582765eefbdb56/output.txt

Total script time: 2.48 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/3e05f4394abea18/output.txt

Total script time: 7.96 mins

  • Unit Tests: FAILED

…ent from the `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.
@Snuffleupagus Snuffleupagus changed the title Attempt to support fetching the raw data of the PDF document from the PDFDocumentLoadingTask-instance (issue 15085) [api-minor] Attempt to support fetching the raw data of the PDF document from the PDFDocumentLoadingTask-instance (issue 15085) Mar 16, 2025
@Snuffleupagus Snuffleupagus requested review from timvandermeij and calixteman and removed request for timvandermeij and calixteman March 16, 2025 09:13
@timvandermeij timvandermeij merged commit d86045e into mozilla:master Mar 16, 2025
9 checks passed
@timvandermeij
Copy link
Contributor

Looks good; thanks!

@timvandermeij timvandermeij removed the request for review from calixteman March 16, 2025 11:32
@Snuffleupagus Snuffleupagus deleted the issue-15085 branch March 16, 2025 12:44
@ericonr
Copy link

ericonr commented Mar 17, 2025

Cheers, thanks!

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
4 participants