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.
Forum › How do I...?
Header logo on top of each page
For example this?
@page {
@top-center {
background: url('test.svg') center no-repeat;
background-size: 300px;
content: " ";
}
}
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.
Please ensure that the page has adequate margin-top to contain the image, otherwise it may not appear.
It does work for me, Mike's advice is probably spot on if it didn't work for you. Any success?
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.
Maybe you could post an example file or extract of code?
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.