how to create a PDF file uing javascript in IE - javascript

I want to create a PDF file based on users' query result (in html table).
What is the best javascript/lib I can use for IE?
I found jsPDF but it does not support IE.

Javascript has no support for PDF.Instead if u want to convert the HTML page you are into you can try PDF4ML

I didn't think it was possible to create a PDF entirely in client-side JavaScript. I would imagine any "JavaScript" examples out there use both JS and a server-side language. In the past, I've used the active PDF API with C#.

Related

How to generate pdf from html and css in Vuejs?

I'm working on a tool "Resume Builder" using Vuejs. Is there any bettter way to generate pdf ( of resume ) from html with css . I have used jsPdf Library but not getting desired outcomes. I want to keep html "a" tag clickable in generated pdf. I have also tried html2canvas.js but in that "a" tag is not clickable due to image in pdf. jsPdf is generating pdf but not applying css.
I recommend you to investigate a bit different approach for generating PDF from HTML just because all the client-side libraries for HTML to PDF generation have lots of problems when generating really complex documents with lots of formatting etc.
The alternative way is to perform the PDF generation itself on the server-side. For example, you could make use of Headless Chrome managed by your backend for turning any HTML into PDF.
We used a very similar approach to implement pdf generation for this free resume builder service. The only downside we faced was that different browsers like Firefox or IE might occasionally display an HTML document a bit different than it's printed out as PDF bu Chrome. Good luck!
You might want to give Pdf Make a try.
PDF Make on Github
It has support for styling and links. But you have to do most of the styling yourself.
I found Kendo UI is the best api for pdf from DOM.
https://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom

convert contents of a div to pdf

I want to convert the contents in a <div> to a pdf.
The <div> contains information in various languages as well as images.
I want to use jQuery or C# asp.net.
How can I achieve this?
MrRio/jsPDF Client-side JavaScript PDF generation for everyone.
Simply include the jsPDF library in your , generate your PDF using the many built-in functions, then hook up a button to trigger the download. All the examples here use jQuery.

Exporting data to excel using javascript under following constraint

I have a project on exporting data to excel using JavaScript. But the constraints are : It should work for all browsers unlike ActiveXObject(that works only for Internet Explorer), window.open(that doesn't works for internet explorer).
It should not depend on other applications like Flash (I have seen a code using jQuery and Flash, but I can't use that in my project) e.t.c.
Please tell me whether it is possible and if it is, then suggest me a method to do this...
And one more thing, Manual work shouldn't be there or if it is, then it should be very less. In other words, it should be completely automated.
Suggestions:
use CSV file format and write a CSV writer in JavaScript yourself
use Microsoft's Office Open XML file format (xlsx) and write JavaScript code that generates such a file (should not be too difficult as it is XML based and there should be a lot of code around generating XML in JavaScript)

how to generate a pdf file of an html page through java script programming

In my html5 hybrid iPad application i am generating a report in one of the pages . What i want is to generate a PDF file of that report and save it in ipad.Please help me with this. I am using JavaScript and mobile jQuery for this.
It is highly inefficient to do this client-side(via Javascript). You should consider doing it server-side(using PHP, ASP/.NET or such). PHP uses a service called iTextSharp for this, PHP uses DOMPDF.
If you want to it with Javascript, http://html2canvas.hertzen.com/ is the best tool you will find! It uses the DOM style to generate an image. The only thing you need to do is then wrap it in a PDF. Have a look at their examples! For example:
http://html2canvas.hertzen.com/examples/artificial/index.html
You can use an open-source library for generating PDF documents, I have already use this library and works fine:
http://code.google.com/p/jspdf/
Try it, I hope that is what you want

reporting with javascript

Is there a way to reporting with javascript to generate pdf file?
You can go for jsPDF.
jsPDF is an open-source library for
generating PDF documents using nothing
but Javascript. You can use it in a
Firefox extension, in Server Side
Javascript and with Data URIs in some
browsers.
Assuming you mean "JavaScript running in a browser" then, "No, not in any practical way (since, while you can use data: URIs, they see limited browser support and limited file size)".
If you are talking server side JS, then you can generate whatever data you like, including PDF. There is at least one library that helps you do that.
Take a look at Stimulsoft Reports.JS that is a pure JavaScript tool. It supports export to PDF, Excel etc.

Categories