Exporting image into excel in javascript - javascript

I want to export my html page into excell sheet which contains some svg charts and html tables. I searched a lot and couldn't find any solution in javascript. I could find a php solution in this. Only thing i found is a node module(here) which i think cannot be used in a web page js file.

Finally got a solution for inserting image into excel in Excelbuilder.js.
We can insert image by specifying cell or offset positions using this plugin. It works.

Related

How to add a file inside of an excel spreadsheet?

I'm currently using node-xlsx library to generate an excel file.
I'd like to add a file, specifically an image object, inside of the excel I'm creating, so that the user can just double click on the cell to open the image.
The alternative way would be to produce an excel and an external jpg file and put an hyperlink to it into the cell, but I think the first idea would be more user friendly...but I can't find a way to do that!
Can you help me finding out if it is even possible with node-xlsx or an equivalent library?

create dynamic image with php

I need to create image chart dynamically as shown bellow,
First I tried with php ImageCreate but it is hard to manage the space with that.
Then I tried the html5 canvas and that is also having a same issue. What I need to know is whether there is an easy way to do html to image conversion. Then I can manage the space easy with other styles.
Thanks in advance.
With wkhtmltoimage you can convert HTML to an images. You would need a VPS to run it on though. You can then create the HTML and call wkhtml2image via PHP to convert the given HTML to an image.
I am creating dynamic image with php with `GDLibrary. Here is the script of creating dynamic image.

ng-grid to PDF using jsPDF or other library?

Hi I have an AngularJS ng-grid.
I am trying to find a way to use jsPDF to render it as a PDF. I have successfully managed to render PDFs of simple text and complicated SVGs via their URI...however when I try to create an image from the ng-grid the image fails, and when I try to use the jsPDF plugin for fromHtml it takes away all the CSS even though I explicitly add it back in.
Any suggestions?
Here are some related posts but they are not angularJS specific:
Export HTML table to pdf using jspdf
Export HTML table to pdf using jspdf
I tried doing the exact same thing as the second post and I get all of my data in a long list since angularJS doesn't uses standard tr and tds to make tables...it just a lot of divs with CSS.
jsPDF worked well after I made my own version of ng-grid-pdf-export.js to use POINTS rather than MM in the calls for the definition of table info. Otherwise, the row spacing was much too large!

How to generate a PDF out of a rendered HTML element?

Is there a way to generate a PDF file in JavaScript out of a given rendered and styled element of a webpage and its content? Is there already a library for this?
I've never put it to use, but could https://github.com/thebluber/htmlToPdf be what you're looking for?
There is a library called jsPDF. It provides basic functionality to create PDF documents. It even comes with a plugin to add elements from basic HTML.

How add custom content HighCharts PDF export?

I am generating a graph and html table with graph related info in a collapsible div.
Now the problem is I need to add the div content to my PDF export and not just the Graph, I see that there is a chart.exportDivElements but I could not find a related sample on how to use it.
Anybody has an idea about this? or an alternate to export highchart and a specific div to PDF via javascript?
I implemented the export server and saved the svg file (did away with the convert to jpg/png code as was not needed) to the server and used tcpdf to generate PDF with svg and required content, it was a bit hard to understand how to export server worked by got my head around and worked very well.
You can't. The export server exports the chart SVG, not any arbitrary html content of the page. A possible solution is to the alter the export server and introduce an extra POST parameter 'customHtml'. In the phantomJS script you have to detect if the parameter is set and write the tablecontent to the page before it is rendered.

Categories