I am trying to create an online CV maker.I intend to use HTML form to get input from user and then put this text into a template/file. I am not able to figure out that how can i do so using JavaScript? Please guide me,Thank you
Asked
Active
Viewed 1,032 times
0
-
1Possible duplicate of https://stackoverflow.com/questions/742271/generating-pdf-files-with-javascript ? – Sim Hm Sep 04 '20 at 16:35
-
Thanks for your help.Can you please let me know how can i import my data(input taken from user using html form) to the solutions offered in the answers.Sorry this is the first time i am working with data or files. – Mankrit Singh Sep 04 '20 at 16:43
1 Answers
1
First, in javascript you can get your input from the HTML by using javascript/JQuery
var input = document.getelementbyid("#id").value
or
var input = $("#id").val()
Then proceed like explained in the example of the topic (Generating PDF files with JavaScript)
var doc = new jsPDF()
doc.text(input, 10, 10)
doc.save('a4.pdf')

Sim Hm
- 97
- 3
- 13
-
Thanks for the answer i am new to this so will try and respond soon – Mankrit Singh Sep 04 '20 at 18:11
-
Use an id for each input of your form -> Upon validation, get the value(s) with JS or Jquery using the id(s) of the input(s) -> Generate the PDF using the jsPDF library – Sim Hm Sep 04 '20 at 18:20