PDF.JS - How to store PDF on server - javascript

I am new to pdf.js. I am able to view PDFs using the example viewer and all is good. I'm able to view an interactive Acroform and fill out the fields too. When I view the Acroform, the "download" button mysteriously disappears. I type some data into a text field on my PDF form. Now, I would like to upload the PDF (with the data in the text field) to a server side servlet. To simulate, I tried to download but, remember? The button is missing! So, I open the dev tools in chrome and unhide the download button and click it. Viola! It downloads the PDF to my local drive (with the data in the text field).
Now, instead of going to my local drive, I was to POST this to a servlet and save it server-side.
Any clues or hints would be greatly appreciated . . .

Related

JavaScript: Save PDF in the 'Microsoft PDF reader'

my web app opens a PDF inside an Iframe. Users can then add texts, draw with digital ink and highlight text. As the PDF is rendered using the user's browser-engine, I recommend trying it with the latest Microsoft Edge.
I would like to save the edited PDF to the location I opened it from with the click of a button.
The PDF editor of the browser has a save feature, but users have to select the location first, and confirm that they are overwriting the file.
Is it even possible because Microsoft Edge seems to isolate the PDF process. When I open a PDF in Edge without my web app, I can simply click the save button, and it will be saved at the location I opened it.
I could not find any documentation for microsoft pdf editor and how to interact with it.
Full code of my project: https://github.com/joseftogo/PDF-Notes-Manager-Alpha
Thank you!
I agree with KJ's opinion. When you open a pdf on a website in Edge, you're actually view it online. So it's wrong to say "save the edited PDF to the location I opened it", it's not opened from local file path. If you want to save it, you're not overwriting any file on your computer, you're downloading a new file to your computer, so you have to select the location first. It's the necessary process.
For the situation you say, "When I open a PDF in Edge without my web app, I can simply click the save button, and it will be saved at the location I opened it." I think that's when you open a local pdf file in Edge. At that time, Edge is just a viewer, and the pdf is already existed on your computer so of course you can overwrite that file directly.

JS library to view and fill out PDF form in web browser

Current UseCase:
Our customers send PDF forms to their employees via email.
The employees saved the PDF form attachments locally, then they fill these forms out and send it back.
Future UseCase:
Our customer want to upload the PDF form to its server, then send a link to it to the employee. When the employee clicks the link, the PDF should open inside the browser (without any browser plugin required). The employee fills out the PDF form and clicks a save button. After that a new filled out PDF should be saved at server side.
Before I gonna write this by my self, I did some research for existing solutions on this. I was searching for a JavaScript library I can embedd in the website and which is a PDF viewer, filler and "saver". But I couldn't find a solution which fits my needs so far.
Any suggestions how to reach that goal? Is there any library (properitary or open source) out there I could use?
Thanks!

Save PDF to server instead of on client machine

I have a URL http://test.com/test.pdf this link opens the PDF in browser fine. Now I have a form inside this PDF like first name, last name etc.
The user fills in this form and I want to upload it to server. The Save button inside PDF would save the file locally. Instead I need a separate Save button that can convert the PDF and it's data to byte array and submit to my server.
Is this possible?
Unless you limit which PDF viewers can be used, you won't be able to do this. Most modern browsers will display the PDF with their built-in viewer but most of them can't deal with forms and when they do, they get it wrong. However, if you can force the PDF to download and open in Adobe Reader, you can add a button to the PDF that will submit the entire filled form to your server as the body of an HTTP post (not a file in a multi-part form submission). When creating the submit button, use a fully qualified URL to your script that saves the file to your server. It's super easy.

Uploading file without triggering the upload window, client side

I have been searching all over and I can't find a solution, I know it is not possible for a website to automatically upload a file without user interaction, but, is it possible to upload a file without having to manually click on the upload button and search for the file, client side. I am sorry if I'm not clear since I do not have much experience in this field.
This is the page I have tried : http://www.jist.tv/create.php
I basically been trying to make the page know what file i'm trying to upload without using this input window.
This is the script the page uses to upload the file : http://www.jist.tv/vendor/uikit-2.24.3/js/components/upload.min.js
Is there a POST message I can send?
Any help would be great, thanks.

AngularJS (HTML, CSS) to pdf in client side

i'm making web for a internet cafe with angularJS.
When user has been registered, they will see their member card in HTML format with button print.
If the button clicks, it will download automatically the member card as a pdf file.
any ide ?
it wil be helpful if you make an example code :)
thank you.
You can use phantomjs PDF rendering. rasterize.js rasterizes a web page to image or PDF.

Categories