Zebra card printer, Java SDK and units

Hi, I'm trying to print id card with Zebra ZXP 7 Series printer using Java SDK and I need some hints to understand how should I calculate dimensions.

For example this method:

ZebraCardGraphics.drawImage(byte[] imageData, int x, int y,int width, int height,float transparency, RotationType rotation)

gets Integers as x and y coordinator, width and height.

I guess it's pixels.

How to calculate these values from centimeters?

What is the density? Can I read density (pixel/centimeter) from printer with SDK?