본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Change print settings of browser using javascript

more options

In my PHP website I am using dot-matrix printer to print invoice bills for my costumers and use the roll paper for this. when I print using Javascript, The printer prints the contents of the bill on the paper by skipping the paper out up to A4 paper length (In my Firefox browser default print paper size is A4). But the length of the content of the bill may not be A4 length. It may less or greater than this. So in short, I need to control the paper size of the browser dynamically. The printer should stop the paper ejection on the completion of bill data.

To do this I am using Js Print Setup Add-on and adjusting paper height settings of the browser for each bills through javascript library associated with this add-on. But it is not a perfect solution because in future the add-on my not be supported by firefox. The new Firefox (Firefox Quantum) not support this addon. So I am using an older version.

I need a permanent solution and full control on printer settings of browser (via javascript code) like Printing device, paper size, margins, show or hide print dialog window, ect. And that should work independent of any add-ons.

In my PHP website I am using dot-matrix printer to print invoice bills for my costumers and use the roll paper for this. when I print using Javascript, The printer prints the contents of the bill on the paper by skipping the paper out up to A4 paper length (In my Firefox browser default print paper size is A4). But the length of the content of the bill may not be A4 length. It may less or greater than this. So in short, I need to control the paper size of the browser dynamically. The printer should stop the paper ejection on the completion of bill data. To do this I am using Js Print Setup Add-on and adjusting paper height settings of the browser for each bills through javascript library associated with this add-on. But it is not a perfect solution because in future the add-on my not be supported by firefox. The new Firefox (Firefox Quantum) not support this addon. So I am using an older version. I need a permanent solution and full control on printer settings of browser (via javascript code) like Printing device, paper size, margins, show or hide print dialog window, ect. And that should work independent of any add-ons.

모든 댓글 (1)

more options

Don't hold your breath for this to be supported in Firefox: https://github.com/edabg/jsprintsetup/issues/39

There has been some work on CSS related to paged media, but current browser support is limited, in particular, you cannot specify that the paper is A4.

https://developer.mozilla.org/docs/Web/CSS/CSS_Pages

It sounds like for your needs you should distribute your own application, or continue to use Internet Explorer 11 with an ActiveX control.

Or can you generate PDF output?