mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.01k stars 9.93k forks source link

Javascipt: Submit/Export Form action doesn't work in Firefox #13266

Open harrysingh1009 opened 3 years ago

harrysingh1009 commented 3 years ago

Attach (recommended) or Link to PDF file here: Sample PDF.pdf

Configuration:

Steps to reproduce the problem:

  1. Open the PDF file attached to this ticket in Firefox.
  2. Try clicking on the "Submit" or "Export" buttons at the end of the document.

What is the expected behavior? (add screenshot)

Clicking Submit should submit form data to the URL specified. (in this case, google.com) Clicking export button should pop up a window to ask user to save the file.

What went wrong? (add screenshot)

Clicking them doesn't perform the respective action of Submit or Export.

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

Snuffleupagus commented 3 years ago
harrysingh1009 commented 3 years ago

@Snuffleupagus Thanks for your response. So, does that mean that the functions/APIs "exportAsXFDF" and "submitForm" have not been implemented yet and I cannot use it? Or there is a way to implement it from my side?

Thanks

marco-c commented 3 years ago

@calixteman maybe we should show a message saying something like "This action is not supported"?

calixteman commented 3 years ago

For now there are no plan to support submitForm function since no function involving network are supported. @marco-c, why not.

tbruckmaier commented 3 years ago

Is this something on the roadmap? Or is it a design choice to not support network functions?

calixteman commented 3 years ago

We need to see with security team if there are any concerns to implement functions involving network. For now it has been decided to not implement them.

dr-death2 commented 3 years ago

From my point of view implementing network functions should be a no-go.

PDF should be used for what it was made for: transferring static content between systems. PDF format was bloated in the past with lots of senseless functions like interactivity, dynamic content like flash or video, scripting etc. Like many of Adobes ideas, this introduced lots of security flaws and ruined the usability for the original purpose.

Implementing above mentioned things into PDF aim eventually in making a second, parallel "standard" concurring to the possibilities of HTML. This is a conceptual problem per se.

People who miss interactivity in PDFs, transferring data to externals severs, linking external content, video etc. should answer the question why the do not use HTML for things like that.

In my opinion, for tasks like the above, PDF is the wrong tool. Mozilla should NOT support establishing concurring standards and NOT support using the wrong tools for the wrong task by the price of ruining usability, security and privacy.