Save Changes and Email PDF (Chrome) - javascript

I have PDF form hosted on a local server
I created a web page where this form is embedded via iFrame
I have a submit button on that page said page
What I need to figure out:
If submitBtn is clicked > save the PDF with the user's changes to a
predetermined location on our network with a unique name (could be a
simple numeric iteration) > generate a link to that file for the user
to copy
If this possible? I'm very new to JS.
Thanks!

Related

Downloading/Saving HTML embedded PDF with JavaScript

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.
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.
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.
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.
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
Note the forms layout has changed overtime. :-) and the wrong surname that needs re-edit later.

Button/function to download HTML form entries into a PDF

I am creating a very basic HTML page that can be accessed off-line. The goal is that the user fills in a form in that HTML file and after pressing a (submit) button, the form entries are downloaded to the user's PC in PDF.
I have tried already to create something, but I cannot get further than a new window > print function, which creates a new browser screen, puts the data there and prompts the user to print it; then the user can save as PDF iso printing.
But I would like to have a button that saves the form as PDF so to not give the end user that hassle.
var mywindow = window.open('','PRINT','height=800,width=800');
mywindow.document.write("here all the text");

Chrome extension to copy data from a specific location from each tab

I have a task where in we have specific data of an element open in a webpage and there are multiple elements data opened in multiple pages. The data I need is located at a same location in each webpage. I need to copy the entire row of that data and as sson as I flip the tab by Ctrl + tab the next data of next element should be copied too and in the end I need to export them in an excel file.
I would appreciate if someone can tell me how do I go about it.
I want this to be done as a browser extension.
You can enable a Chrome extension allowing you to execute any Javascript of your own on any website.
For example this extension "Custom JavaScript for websites" : https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
You Copy/paste in the textarea of this extension your Javascript such as mydata = $("#element_i_want_to_copy").text(); console.log(mydata);
You can then retrieve in Chrome console the data...
If you want that the Javascript on every page send the data on a page of your own that will centralize automatically all the data sent by each Chrome tab loaded page, then you can use online (free) services like "Pusher", cf https://pusher.com/.
The Chrome extension "pushes" the data on your html page, that "receives" the message and displays it in a textarea for instance or a html of your choice...

How to embed in html page a PDF generated on the fly with jsPDF

I had project with java that created the pdf from the back-end and saved that pdf for while so the user could download that file within a frame of time, so embedding or sending that file was easy because it have a physical copy in the server, now for this project the pdf is generated with the dynamic html content the user chooses with jsPDF, but this file the user only can save it directly to his/her computer.
There is a way to show this pdf generated on the fly embeded in a html page like a modal/div or a tooltip (for a thumbnail preview)?
It would be better if there is mobile friendly solution.
Since mobiles have some issues with iframe i'm not considering that as an option.

Change content dynamicly in google chrome extension development

I have login form in chrome extension. I check if username and password true. I want if user loggined in extension content (html page ) must be change. And after that when i clicked extension logo i dont want user see login page. How can i do that?
Your question is not very clear. But seems like you want to simply display different HTML page depending on whether a user has logged into your extension.
A simple way to do that is, make user first login to your extension. Define some variable like "logged-in-state", initialize it to "not-logged-in". Change it to name that the user logged in with after successful login. Flush this information to localStorage.
Next time when your extension starts, read this variable from the disk.
Every time, any page from your extension loads, make it send a message to background script requesting for that variable. If the value is "not-logged-in" then display login/password. Otherwise, display regular content.
Basically, assign various classes dynamically to HTML content for different states like logged-in/not-logged-in and have CSS rules that will hide based on the class value.

Categories

Resources