I am aware there is a dialog window for it, but firstly: I don't know if I have to extract those values and if yes, how; secondly: it would be better for me to hardcode the paper size because it would be annoying at runtime if every time I want to print I have to deal with a popup window. So I would only use it if there is no other way I can do it.