Export google chart to pdf using pdfbox - charts

I need to export a google visualization chart to pdf in my Java EE application. Looks like all client side pdf tools (eg. JSPDF) are using HTML5 features and will not work in IE9 or below.
<img id="gChartImg"></div>
$("#gChartImg").attr("src",chart.getImageURI());
We're already using pdfbox to export the html to PDF. Is there any way to get this image in server side using $().ajaxform or webservices.
Any help is appreciated.

Related

Export leaflet map as PDF to server

I use Leaflet to display basemaps, wms layers, multipoints, multipolygons and multilinestrings. Is there a way with JavaScript to directly, upon button click, save screenshot of map as PDF with document header and footer (image in the middle) on the server?
Today I am able to save screenshot as PDF locally on my computer with help of Leaflet plugin browser-print and print-save it as a PDF. I can then upload the file to the server and all is well. However, I want to skip this manual part of printing map as pdf, save it locally and then upload it.
You can try this package works great:
https://github.com/grinat/leaflet-simple-map-screenshoter
I used it with Vue.js and make it a screenshot from WMS and Geo maps as well.
Send the data like base64image on a server and there I use https://github.com/puppeteer/puppeteer to create a PDF.

Download zing chart as pdf using itextsharp

I am using zing chart to display various charts on client side. Now there is a requirement to download all the charts in one pdf. For pdf generation I am using itextsharp. Is there any way by which I can integrate zing charts so that itextsharp can render and create pdf containing all charts?
No, there isnt'.
I think the best way to solve your usecase would be:
1. to send a call to the server (containing information about what charts the user wants to have)
2. at the server side, handle incoming requests by producing the graph (as an image), adding all images in a pdf, pushing the bytes of the pdf back into an HTTP message
For generating charts at the server side, have a look at http://nugetmusthaves.com/Tag/Chart

how to convert HTML page to PDF using ITEXT or PDFCROWD API

PDF created will be based on dynamic HTML page.
Using ITEXT 5 or 7 with XMLWORKERHELPERCLASS would be lengthy process.
If i am using pdfcrowd API it seems to be ok but not able to generate on localhost or any other private ip. I am ready to pay for their services if they achieve above issue.
First you need to get iText 7 (the core library) and the pdfHtml add-on (the part that will parse the HTML+CSS and convert it to iText objects). Go to github to find out how to download these.
Suppose that you have this HTML:
With this corresponding CSS:
Then you can use this code snippet:
ConverterProperties converterProperties =
new ConverterProperties().setBaseUri(resoureLocation);
HtmlConverter.convertToPdf(
new FileInputStream(HTMLSource),
new FileOutputStream(pdfDestination), converterProperties);
Where resourceLocation points at your base URI, HTMLSource is the path to your HTML file, and pdfDestination is the path where you want the resulting PDF to be written.
When you execute this code, you will get the following PDF:
Note that buying a commercial license may be necessary if you intend to use iText in the context of a proprietary software project.

Converting HTML to pdf in GWT Client side

Is there a way to convert some html to PDF in GWT Client side
I have seen some libraries like iText , but they all seem to work on server side .
can i get the PDF without involving any server side work
is there any possibility
Thanks
I think you can use this JS Library to generate pdf on the client:
https://parall.ax/products/jspdf
or look in this SO question: Generating PDF files with Javascript

How to generate chart and save as Jpeg by using Gwt visualization API

GWT,Java framework. I wanted to generate chart and save it as jpeg file for sending report's graph to user's email.
I am using GWT visualization api to generate chart for fron-end view. But I wanted to generate chart and save it as jpg in server side.
can any one help me that How to save file as jpeg in server side by using GWT visualization api?
I know a script which can export SVG chart to other format. Do you users' browsers support SVG ?