HTML border repeat/expand on new page

33 views
Skip to first unread message

Georgios Pediaditis

unread,
Apr 25, 2023, 2:53:46 AM4/25/23
to wkhtmltopdf General
Hi!
Im trying to create a pdf file where the template consist of a green vertical line on the left side of each page and a green horizontal page only on the first page.
In order to do that I set the left html border with color green and added a margin-left on  the css of html
When I add a new page the vertical line on the left (html border) extends only until my last line. Not covering the whole height of the page.
I attach two images of the pdf document. The current and the desired outcome.

My html css=>
html {
border:0px;
margin:0px;
padding:0px;
border:0px;
margin-left: 50px;
padding-left: 0px;
border-left: 150px solid #27ac88;
position: relative;
page-break-after: always;
width: 100%;
/*height: 3964px;*/
overflow: hidden;
text-rendering: optimizeLegibility;
}

The arguments for calling wkhtmltopdf through python=>

options = {
"enable-local-file-access":None,
'page-size': 'A4',
'margin-top': '0',
'margin-right': '0',
'margin-bottom': '0',
'margin-left': '0',
}

the html code for new page=>

<div style="page-break-after: always"></div>

current.pngdesired.png
Reply all
Reply to author
Forward
0 new messages