I think you are very unlucky trying to do this in HTML and CSS. Most of the problem is that the printer fields are of the type of printer: most printers have the minimum margin they can install (which is equivalent to the space they need to capture the page and moving their heads left / right).
Valid margins will also vary depending on the paper size (the margin size can usually be smaller on a smaller sheet than the maximum that the printer will accept). For example, if you load A5 paper into an A4 printer, the margins you can set will be different if you load A4.
None of this information is available on a web page, through CSS, javascript, or anything else.
Now, with regard to the solution, PDF files allow you to embed some default printer settings in a file - Acrobat pro allows you to specify the zoom settings, default numbers for copies, etc. I would not mind betting that in a file format that Acrobat does not disclose, there are more potential settings.
There are many fully functional tools for creating PDF files for any server technology used. good ones will even allow you to provide a URL and display HTML + CSS in PDF content - this will somewhat automate the creation. The generation of the PDF code is quite intense, although it will not be smooth for the user (and for most browsers, PDF plugins will be required).
I know this is not perfect, but this is the prospectus that I would study. Good luck
source share