Downloading/Saving HTML embedded PDF with JavaScript

Viewed 43

I have a page with embedded PDF.

<object data="/files/documents/somepdf.pdf" type="application/pdf"></object>

The embedded PDF has a form that user can edit.

enter image description here

This PDF view has a button (top right save/print icon) that allows user to download edited document.

Question - is there a way to manually download or save edited PDF with JavaScript?

My goal is for user to be able to click on "Submit" button and it takes the filled out form and sends it to some API end point in my system.

1 Answers

Question - is there a way to manually download or save edited PDF with JavaScript?

That's a loaded question, As with ALL PDFs the Form has been downloaded into the users browser or external pdf viewer, so no your JavaScript cannot touch it, see the downloaded address at the top. enter image description here

The other implied question is can the file be saved after edit by the user clicking the icon, and that answer is perhaps. See the Adobe banner when a user attempts to edit the restricted form.

enter image description here

Thus the user must print the form with handwritten entries and signature, then mail it using their choice of US snail mail or web mail provider.

It also depends very much on which Browser and form they are using since here the user Fred has printed some entries and thus can continue another time after going bowling

enter image description here

Note the forms layout has changed overtime. :-) and the wrong surname that needs re-edit later.

enter image description here

Related