Forum How do I...?

Scale image in header

chops
Hello!

I want to insert an image to the top-right corner of each page:
@page { 
    size: A4 landscape;
    @top-right {
      content: url('logo.jpg');
    }
}


The image logo.jpg is 400x125px. How can I scale down the image to 160x50px?

This code doesn't work:
@page { 
    size: A4 landscape;
    @top-right {
      content: url('logo.jpg');
      width: 160px;
      height: 50px;
    }
}


Thanks in advance
Christian
mikeday
The dimensions of page margin boxes are defined by the page margins themselves, so it might be easier to put the image in a regular element in the document, style that, and then flow it to the margin box instead. Alternatively, you could use the prince-image-resolution property, but specifying a DPI value may not be as convenient.
jim_albright
Or you could change the logo to the proper scale itself if you have control over it. I would use the free IrfanView to do it.

Jim Albright
Wycliffe Bible Translators

Edited by jim_albright