简体   繁体   English

使用HTML CSS打印帐单-打印A4

[英]Printing a bill using HTML CSS - Printing A4

I am trying to print a bill which is generated as an HTML page. 我正在尝试打印生成为HTML页面的账单。 I am using @media print, and have tried giving page size. 我正在使用@media打印,并尝试提供页面大小。 However, the length of the bill is always coming as long as an A4 page. 但是,账单的长度总是和A4页一样长。 I tried checking if there are any printer settings that says A4 and have not found anything of that sort. 我尝试检查是否有任何打印机设置显示A4,但没有找到任何此类信息。 I have also given page break at the end of the div which is my bill 我还在div末尾给了分页符,这是我的帐单

Could someone help me out? 有人可以帮我吗?

I finally solved this problem after several hours of breaking my head. 经过几个小时的努力,我终于解决了这个问题。 I am leaving this for someone else who might face a similar issue. 我把这个留给可能面临类似问题的其他人。

When printing through Chrome, there is a setting called "Headers and Footers" - It basically prints the url of the page at the top and bottom. 通过Chrome打印时,有一个名为“页眉和页脚”的设置-它基本上在顶部和底部打印页面的网址。 However, if you uncheck this option, it will print it properly 但是,如果取消选中此选项,它将正确打印

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

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