My task requires me to click a button on the webpage and download the data as a pdf file. Simply printing the webpage wont do as there are certain tabs which are visible only upon selection.The data source is readily available on the pagenameVM.js. I tried using jsPDF but that works only for a certain div in the page.I need to write the all the required data into the pdf and then download it. Is it possible?
Asked
Active
Viewed 44 times
0
-
1try priniting page and save as pdf file – Hemant Rajpoot Nov 07 '17 at 04:24
-
Yes it's definitely possible. With enough coding knowledge you can custom print anything you want from a page. However it's hard to answer your question directly without seeing some code. Can you please post some? Otherwise any answers will just be taking a shot in the dark. – YAHsaves Nov 07 '17 at 04:34
-
`I tried ...` did you? perhaps you did it wrong – Jaromanda X Nov 07 '17 at 04:47
-
Have you tried using TCPDF ot mPDF? – Nikko Dela Cruz Nov 07 '17 at 05:38
-
var doc=new jsPDF(); this line shows exception" 'jsPDF' is undefined" when IE 8 is used in Document mode Emulated ,however when in debugger i alter it to IE10 it works. – rookiecoder Nov 07 '17 at 08:01
-
https://stackoverflow.com/questions/44719019/cant-create-instance-of-jspdf-class-error-jspdf-is-undefined-ie11 – rookiecoder Nov 07 '17 at 10:08
-
@JaromandaX this is the issue i am facing https://stackoverflow.com/questions/44719019/cant-create-instance-of-jspdf-class-error-jspdf-is-undefined-ie11 – rookiecoder Nov 07 '17 at 10:41
-
so, the problem you are facing is that jsPDF isn't working in IE11 when you load a page using `file:///` protocol schema? easy, tell IE11 that it's safe to run javascript in a locally loaded page – Jaromanda X Nov 07 '17 at 11:00
-
@JaromandaX thanks for the response.I tried doing that it did not work !!Is there any other way i can create a pdf from my C# code and download it into the browser upon the click of a button.. – rookiecoder Nov 08 '17 at 04:38
-
@HemantRajpoot that would not serve the purpose as all the data is not visible at once in the page – rookiecoder Nov 08 '17 at 04:48