Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Examples

Line5 e.K edited this page Apr 20, 2016 · 1 revision

Image as PDF page background (Letter Paper)

Any image can be set as full-sized page background, which might be helpful for flyers, invoices (letter head), or any other company documents. It is important to explicitely set he size of the body element to the paper size in cm/inches, because otherwise the background image appears to be pixelated and blurred.

It is recommended to use a high-resolution picture of an appropriate size!

<html>
<head>
  <style type="text/css">
    body {
      margin: 0;
      padding: 0;
      width: 21cm;
      height: 297mm;
      background-image: url('http://example.org/my-highres-a4-letterhead.jpg');
      background-size: contain;
      background-repeat: no-repeat;
    }
  </style>
</head>
<body>
  <p>Hello world!</p>
</body>
</html>
Clone this wiki locally