Save PDF to server instead of on client machine - javascript

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.

Related

PDF.JS - How to store PDF on server

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 . . .

I want to send email with pdf of current web page in Meteor

1) I am currently downloading pdf of web-page using function window.print()
2)but now i want to send that downloaded pdf in email as a attachment.
3)I am not able to access that pdf in my code
how i will be able to send that email with pdf in just one click?
You can try get a screenshot of your window then put it on a pdf.
see this two plugins
http://html2canvas.hertzen.com
https://parall.ax/products/jspdf

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!

Script that uploads users file from an exact location

Working on a project where we're using an XML of a user's iTunes tracks and play lists to integrate into other services. On Mac, this file is stored in the default location at /Users/username/Music/iTunes/iTunes Library.xml . Since we need users to be able to upload their own XML file, is there a way to write a script that pulls the file from that location as soon as they click an upload button (saving them from having to search and find it each time)? If so, is this something that can be done through Javascript (or through Rails, since we're using that as well)?
Thanks!
If you mean on a browser, no, you can't. The user has to select the file, you can't pre-select it for them. It's a security measure. If a web page could pre-select the file in an input type="file", it would be trivial to auto-submit that form, or hide the input and trick the user into submitting the form, or read the file via the File API and send it to a server — in all cases, stealing a file from the user's machine without their knowledge or consent.

How to upload the files programmatically in fine uploader?

I was able to use fine uploader successfully and it works like charm. But iam not able to figure out one of my requirement.
My requirement :-
I have information of file(file name, fie url, file size) in javascript object .I want to prepopulate the fineuploader container with the file information (basically when my page loads i want to just prepopulate(display) the files info under fine uploader container. Also i want to display delete icon so that clicking it call goes to my action class). Thats it.
I do not want any upload button just display the file info i have in javascript object under fineuploader
It sounds like you want to construct your own File object given the URL of a resource. You can't do that. Fine Uploader allows your users to upload files from their file system to your server. You can enable the "paste to upload" feature (Chrome only) that allows users to copy an image from another site and paste it into Fine Uploader, where the image will be uploaded to your server. If you want to allow your users to submit a resource given a URL, just send that URL to your server and download it server-side.

Categories