Forum How do I...?

Header logo on top of each page

Spavan
Do you have sample css to output an image as the header when converting to PDF? This header should be repeated on all the pages.
hallvord
For example this?

    @page {
      @top-center {
        background: url('test.svg') center no-repeat;
        background-size: 300px;
        content: " ";
      }
    }

Announcement: repos for tests/utils

Spavan
Thank you. Did this work for you ? I am unable to get a .jpg image output on the resulting PDF. Btw I want the header repeated on each page.
mikeday
Please ensure that the page has adequate margin-top to contain the image, otherwise it may not appear.
hallvord
It does work for me, Mike's advice is probably spot on if it didn't work for you. Any success? :)

Announcement: repos for tests/utils

Spavan
I have enough margin I think. My image is width: 244 pixels, height 58 pixels. Margin on css is 150px 100px 200px; page is A4 portrait.
hallvord
Maybe you could post an example file or extract of code?

Announcement: repos for tests/utils

Spavan
Problem was with the path I was specifying for the image. I didn't realise the path was supposed to be relative to the folder where the .css file resides. I just dropped the image file in the same folder as .css and it worked fine.