문제

I have an Epson LX 300 dot matrix printer.

I'm using PHP to create an HTML receipt, and am using Javascript's window.print() to ask the browser to print the web page. Unfortunately the printer can not handle the formatted text. Font sizes are incorrect, areas overlap, etc.

Printing normal text generated in Notepad and Wordpad does not cause any problems.

What can I do to fix this problem?

도움이 되었습니까?

해결책

You need to create different css rules for printing, and set them on your page this way

<LINK rel="stylesheet" type"text/css" href="print.css" media="print">

Inside this css you can set display:none to images, set universal font-size for all elements without changing anything on your site.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top