简体   繁体   English

如何使用PHP-Codeigniter在A4尺寸的纸张上打印mysql数据

[英]How to Print mysql data on a A4 size paper using PHP-Codeigniter

I have four fields in my mysql table and in total there is around 85 rows of information. 我的mysql表中有四个字段,总共大约有85行信息。 Now when any user clicks on a button, I want it to retrieve all the data from the mysql table and print those out on a A4 size paper. 现在,当任何用户单击按钮时,我希望它从mysql表中检索所有数据并将其打印在A4尺寸的纸张上。

For 85 rows of information it probably going to need more than one page, so in that case I also want it to display the page number out of total number of pages- like 2 out of 10. I have tried googling it but haven't found any good tutorial. 对于85行信息,它可能需要一页以上,因此在这种情况下,我还希望它显示总页数中的页码-像10页中的2页。我尝试使用Google谷歌搜索,但没有找到任何好的教程。

Would you please kindly help me how to do this ? 您能帮我怎么做吗? Just for your information- I am using Codeigniter. 仅供参考-我正在使用Codeigniter。

Thanks in Advance. 提前致谢。

to my knowledge, there is not a way to instruct the web browser (html) how to print to specific device. 据我所知,没有一种方法可以指示网络浏览器(html)如何打印到特定设备。 you can play around with the media: print css commands, but that might not be easy. 您可以使用媒体:打印css命令,但这可能并不容易。 were it me, i'd use FPDF http://www.fpdf.org/ or something similar to create the results as a PDF - that way you can completely control the layout and paper size. 是我吗,我会使用FPDF http://www.fpdf.org/或类似的东西将结果创建为PDF-这样,您就可以完全控制布局和纸张大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM