PDF: MediaBox Size for A4 Format Page
Question by Guest | Last update on 2020-11-13 | Created on 2014-03-20
Currently, I am trying to create a PDF document manually. By default, the MediaBox in a Page-Object (visible page size) is defined as "/MediaBox [0 0 612 792]". Apparently, this is the format "Letter".
However, I would like to create a page in the A4 format (DIN A4, ISO-Norm 216). Which values should I use instead of 612 and 792 for my MediaBox?
Related Topics
CSS: Include CSS Stylesheets in HTML
Tutorial | 0 Comments
Adobe Reader would like to save changes to PDF although nothing was changed
Question | 1 Answer
HTACCESS: Force Download of specific File Types
Tutorial | 0 Comments
Delphi/Lazarus: Display current Date and Time
Tip | 0 Comments
Create Custom Error Pages for Website
Tip | 0 Comments
PHP: File Download Script
Tutorial | 0 Comments
PrintMyFonts is not printing all fonts - What can I do?
Article | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The values exact to the fourth decimal place would be 595.2756 and 841.8898 for a page in A4 portrait orientation, so:
However, most programs (as for example also the PDF export from OpenOffice) are using rounded values instead. Without the decimal places, it is:
The data has to be stated in the unit point. One point is defined as 1/72 of an inch (2,54 cm).
The A4 format has width of 21 cm (8.2677 inch) and a height of 29.7 cm (11.6929 inch). Thus, the width in point is 8.2677*72 = 595.2756 and the height in point is 11.6929*72 = 841.8898.
2014-03-21 at 19:39