This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Page border around the pdf generated

jayshree.bhongle wrote on 2012-10-04:
Hi ,
I want a pdf which should have border.
But as you can see in the attached file if I use hrml page border its not working is there anty method by which i can have a border around pdf
support wrote on 2012-10-08:
Let's assume:
- Margins: 0.3 inch
- Border: 3px
- A4: 8.27 x 11.69 inch

Since there is
- 96 CSS pixels per inch
- 72 points per inch

we get

element width: 72*(8.27 - 0.6 - 6.0/96) = 547.74pt
element height: 72*(11.69 - 0.6 - 6.0/96) = 793.98pt

<body style="width:547.74pt;height:793.98pt;margin:0;padding:0;background-color:grey;border:3px solid black">
</body>


The resulting pdf is attached.