webapp-hardware-bridge icon indicating copy to clipboard operation
webapp-hardware-bridge copied to clipboard

Unble to control page size

Open geniuskidkanyi opened this issue 5 years ago • 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

geniuskidkanyi avatar Nov 16 '19 15:11 geniuskidkanyi

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());

stiidk avatar Mar 25 '20 07:03 stiidk

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?

imTigger avatar Mar 25 '20 08:03 imTigger

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() ).

stiidk avatar Mar 26 '20 07:03 stiidk

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

stiidk avatar Mar 31 '20 19:03 stiidk

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());

tfkproject avatar Sep 18 '20 15:09 tfkproject

Does anyone found a solution for this?

mazsa97 avatar May 08 '23 13:05 mazsa97