imTigger/webapp-hardware-bridge

Unble to control page size

geniuskidkanyi opened this issue · 6 comments

when i printing it uses the page size on the printer instead of a dynamic height, is there a way to set height to to dynamic

I have the same problem.. When printing a PDF receipt, a LOT of blank paper is coming out before the receipt..

I have a workaround that could be nice to add to the configuration somehow. Use the documents height and not the PageFormats height from the default job:

paper.setSize(document.getPage(0).getMediaBox().getWidth(), document.getPage(0).getMediaBox().getHeight()); paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());

Currently WHB have no ability to control page/paper size.
It depend the printer's default setting.

Could you tell what type/model of printer you are using?

I am using a Star TSP143IIIBI (Bluetooth).

I don't under understand what you mean by WHB? But the code I posted are working locally when i test it, where I use the document size to set the Paper size ( document.getPage(0).getMediaBox().getHeight() ).

I must have had my head to fare down in the code when I replyed... WHB = webapp-hardware-bridge!!! Doh ;)

I'm facing same problem here, blank paper is coming out. How can I handle this snip? (I'm using TCPDF PHP) even not TCPDF, how to use this set? in html page or what? @stiidk

paper.setSize(document.getPage(0).getMediaBox().getWidth(), document.getPage(0).getMediaBox().getHeight()); paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());

Does anyone found a solution for this?