当前位置: 动力学知识库 > 问答 > 编程问答 >

php - How to generate charts from an excel file and save them to server as a pdf

问题描述:

Ok, so I have a WordPress setup and a client who would like it to generate monthly reports to PDFs and save them to the server. What troubles me is, that those reports should generate charts from data imported from excel files.

How would you do that? Generate the reports clientside and let the user save the pdf to server? I believe rendering the charts on the server would not be as easy as creating the charts with chart.js in the browser.

Choosing the clientside approach I would need a way to parse CSV data (any good WordPress plugins?) then render the report with the charts and give the user a possibility to save a PDF to the server associating the file with the post.

网友答案:

Best approach will be to import data and create chart within html page, then use fpdf to create pdfs on the fly. here is nice how-to integrate fpdf with worpress:
https://forrst.com/posts/FPDF_integration_with_Wordpress_for_PDF_printing-Gr4
and fpdf library:
http://www.fpdf.org/

分享给朋友:
您可能感兴趣的文章:
随机阅读: