ZSDK API to get media size of Printer?

// Expert user has replied.
F Faiz Waghoo 2 years 1 month ago
134 1 0

Hello,

I was looking for an API in ZSDK documentation that can return the media size of any Zebra printer but I couldn't find any.

So if my Android app wants to support multiple Zebra printers with different media sizes, is there a way I can programmatically query the media size at runtime? Accordingly I can insert line-breaks to fit my content on a given media.

P.S.: My question arises from how to manage different font sizes and their text wrap on different printers. Also is there a way to query the width in dots for a given text in a given font?

Please register or login to post a reply

1 Replies

S Steven Si

Assuming the media.type is set to label (not to journal), then calling the SGD API on the zpl.label_length and ezpl.print_width will return the label's width and length. Please note that the zpl.label_length is automatically set during the medial calibration process. The ezpl.print_width is set by the user, for example, the 2" wide label medial roll can be used in a 4" wide printer.

Regarding the question about the font size, with scalable font, you can choose any height and width in dots with ^A command

CONTACT
Can’t find what you’re looking for?