Print Highcharts in pdf format - php

Is it possible to Print the highchart as a PDF using DOMPDF or any other PHP Html pdf generators?

Version 2 of Highcharts includes PDF generation. The Highcharts client side will export an SVG string, and there will be server modules based on Batik that do the conversion to PDF. You can try it out at Link.
This component will only convert the chart itself. If you want to convert the whole webpage or parts of it, check out the server library with the name of wkhtmltopdf (read WebKit HTML to PDF). It converts the charts too.

Take a look at their latest announcement about generating images on the server.
Once you save the images, you can add them to a pdf using libraries such as tcpdf

Please familiarise yourself with the included exporing module and parameters which can be used http://api.highcharts.com/highcharts#exporting

Related

PHP or Jquery Library code that outputs a section of a webpage to a PDF file

I need to find and use a PHP or Javascript library or plugin that can output my html code to a pdf. I have seen libraries such as MPDF, FPDF have a number of limitations, for instance the above mentioned libraries dont render svg elements and charts.
I am currently using MPDF to render html tables nicely but I also have charts and maps on my webpage being output dynamically using Jquery and some other svg elements.
Any ideas?
I use external program to render PDF from HTML(used it with PHP and Ruby) called wkhtmltopdf which renders any HTML using WebKit(with styles, scripts etc) and allows you generate output PDF file. Since it support SVG i think that should be displayed in PDF - but better to use more recent versions because there could be some unsupported features in older one.
system('/usr/local/bin/wkhtmltopdf input.html output.pdf');
You of course can control some options like page orientation and size using arguments

Convert HTML5 Charts to PDF

I am making a tool that needs to generate a PDF report with charts and tables from data that was imported via excel upload.
I would like use HTML5 charts. We are currently using PHP.
I am looking for a a real browser (or something that behaves like a browser) in order to have those html5 charts rendered properly. The new html5 charts rely on javascript, so it's not just a matter of rendering html into pdf, but also executing javascript to generate the charts on the fly.
Any suggestions?
Thanks
ZingChart exports to PDF from canvas, SVG, and VML.
I'm on the team, so if you have any questions about implementation or other features, just reach out!
You might be able to convert the HTML to a CANVAS image (http://html2canvas.hertzen.com/), and then save via jsPDF (https://github.com/MrRio/jsPDF)
What have you tried?

PHP: How to render PDF reports containing charts?

I want to create PDF reports containing some pie/bar charts. I have to create them with my PHP web app and cannot use commandline tools. For the frontend I use flot. However, I don't know how to get these charts in a PDF, because my project is constrained to PHP.
How do I generate images from my charts to render a PDF?
Update: The solution has to be open source since my project will be open source, too.
Best,
Stefan
Of course you won't be able to use a javascript charting solution to generate graphics to be used directly in a PDF. What you could do however, is use a PHP charting solution to create the graphs. Provided you have GD support built-in (it usually is) you could use pChart or libChart to create GIF/PNG charts you can embed within your PDF.
And for PDF generation I would personally recommend using TCPDF.
Can you use PDFLib ?
http://php.net/manual/en/ref.pdf.php
http://www.pdflib.com/pdflib-cookbook/graphics/fill-pattern/

Exporting flash content to PDF?

I am using fpdf.php to export the PDF document from PHP. I'm still facing the problem that I couldn't export flash content in to the PDF
What do you mean by flash content? You should separate data generating code from data displaying code, so you can write two components for displaying data: one for flash and one for pdf.
If you mean to take a .swf file and convert it into a PDF then you will need to find a different solution since the fpdpf.php library, since it doesn't support converting .swf files into PDFs.

swf to pdf using php

Is there any way to convert a SWF to pdf using php. i mean the page has a button on the click it must export the swf contents in pdf.
One approach you could try is to use ffmpeg to convert the swf to a series of jpeg images, one per frame, using the 'image2' output codec (see this part of manual). Then you can select the appropriate frame and build a PDF with it using pdflib, fpdf or similar library.
I've noticed your question states using php, but I was pretty happy with this library:
AlivePDF. It's worth a try.

Categories