I've attached this simple document converted to PDF:
<html>
<head>
<style>
@page {
size: 155mm 235mm;
margin: 21.15mm 19mm 22.15mm 19mm;
background: yellow
}
body { background: aqua }
</style>
</head>
<body>
<h1>Heading</h1>
</body>
</html>
In the generated PDF the page size is given in points:
/MediaBox [0 0 439.3701 666.1417]
This translates to 155x235mm as expected for the sheet of paper.
We draw a cyan rectangle background for the page body:
53.8583 62.7874 331.6535 543.4016 re
The last two numbers are the width and height, again in points (1/72 of an inch). This translates to 117x191.7mm, which is exactly what you would expect from the page size and margin dimensions.
Everything seems to check out, so I am puzzled where is the discrepancy. Do you see any problems if you open the attached PDF in Acrobat?
- page.pdf 14.2 kB