I have to generate a page data of my web site in PDF format. I need to export all the dynamic data with line, bar and pie charts. Is it possible to download in pdf format? For reminder, I am using laravel-dompdf to generate a file.
Let me know if you have any solution for this.
Thanks in advance.
I did research on it, we can not directly convert chartjs into pdf but what we can do is we can convert JS chart into image format and append into tag. Then, we can easily convert them into pdf format.
Let me know if anyone need in detail.
Thanks,
Related
I'm trying to use Laravel Excel (maatwebsite) to build a simple function to upload an Excel file and convert it to pdf straight away.
I'm looking for something like that (conceptual obviously) :
$file = $request->file('my_excel');
$excel_object = Excel::import($file);
$excel_object->export('/my/storage/path/my_file.pdf');
Can anyone please explain how to achieve or point me to a relevant example ?
thanks a lot
Adam
The easiest way would be to use a package like "Html2Pdf". You should make a blade file with your data, render it to HTML and convert it to pdf.
This is similar to how to render DT::datatables in a pdf using rmarkdown?
DataTable has an option to add a pdf button and export and nice looking pdf of the Table. (see https://rstudio.github.io/DT/extensions.html)
Is there a way to do this in Rmarkdown directly? It would save me effort of converting a list of DTs to kable.
I need to convert on the fly an HTML into PDF. I've been using the old HTMLDoc library for a while, but now I need to print SVG graphics and HTMLDoc doesn't support SVG nor base64-enconded images.
So far it seems to me that TCPDF (or a tool based on it) is a good way. The only problem is that I don't want to "build" the PDF document in PHP, as the HTML is dynamic.
Is there any way to write a script that simply takes a portion of HTML page and returns a PDF? That would imply some sort of way to specify start/stop markers in the HTML page (just like in HTMLDoc).
Thanks for any advice,
Thomas
TCPDF has got very limited css support and some bugs with " quotes, so from any html to pdf TCPDF is not an option for you unfortunetly
TCPDF not supports all css functionality, mpdf 6.0 is best ever pdf library for convert html to pdf, It also supports almost required css as well. I prefers htmlcanvas jquery for convert html to image.
i am looking for a method to convert a pdf document into corresponding html document using abcpdf. kindly let me know if it is feasible. FYI, My pdf document has rich text along with images.
You can. Try this. Hopefully it'll work.
var doc = new WebSupergoo.ABCpdf10.Doc();
doc.Read('your Pdf byte array');
doc.Save('your HTML file path with .html extension');
doc.Clear();
doc.Dispose();
For documentation please have a look at the note section
http://www.websupergoo.com/helppdfnet/source/5-abcpdf/doc/1-methods/save.htm
To export as XPS, PostScript, DOCX or HTML you need to specify a file path with an appropriate extension - ".xps", ".ps", ".docx", ".htm", ".html" or ".swf". If the file extension is unrecognized then the default PDF format will be used.
You can definitely convert HTML to PDF, but I am not sure the inverse is possible to do with abcpdf.
Perhaps you can give a try to iText (iTextsharp)
Hi I am using wkhtml to pdf method to genearte a pdf , I need to insert a image in my Pdf Header but i dont want to show the PDF header Image in my HTML page. How can i take direct image for my PDF Header.
Thanks in advance.
probably it could be reached via this:
$pdf->addPage('<html><div id="header">AHOJ</div></html>');
$pdf->addPage('/path/to/your.html');