-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Background color on pdf #3125
Comments
I got a solution for this. Pankaj Jangid one of the wkhtmltopdf developer provide this solution to me.
Here you find sample css and html file . |
FYI if you have margins, they remain white. |
This doesn't work if we are instead loading dynamic content with lots of p tags :( |
I have struggled with wkhtmltopdf for a proper background image for many days, I even tried to use background-position to synchronize display of header footer and content backgrounds, but every approach I tried became a dead end after many attempts. Just use another tool to finish it up: |
So, I ran across the same issue and stumbled op un this problem/solution and spent a lot of hours which I might save someone else fixing this. So in my case we have a table that gets repeated. Sometimes on 1 page, sometimes on multiple pages. By adding a "filler" element after the repeating element (in our case, the table).
Position fixed is key here, along with the min-height. If it's on the first page, it will blend in with the background of the repeated element. |
I want background color on multiple pages of pdf so for that i use background color on body but if content goes to second page then second page have background color till content.
The text was updated successfully, but these errors were encountered: