How do I discover the measures of the printer margins ?

I try yo print a picture byt the .painpicture method to the total width and height of the printer and it prints even in the margins so the total pciture is not shown.

So I want to print the total available area of the printer. How ?

Thanks in advance,