I was able to somehow make this work, following theducks' suggestion, by using the Prince PDF Calibre plugin and the below custom style:
PHP Code:
@page {
size: 17cm 33cm;
margin: 5mm 10mm 5mm 10mm !important;
@top-left {
font-size: 50%;
font-style: italic;
border-bottom: solid thin black;
margin-bottom: 1mm;
content: '';
display: block;
width: 500px;
height: 50px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 10 300 70"><text x="0" y="40" font-family="Arial" font-size="28" fill="red" font-weight="bold">svg header test: @{@{title}@}@</text></svg>');
background-size: 500px 30px;
}
@bottom-left {
font-size: 50%;
font-style: italic;
border-top: solid thin black;
margin-bottom: 1mm;
content: '';
display: block;
width: 500px;
height: 50px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 10 300 70"><text x="0" y="40" font-family="Arial" font-size="28" fill="red" font-weight="bold">svg footer test: @{@{author}@}@</text></svg>');
background-size: 500px 30px;
}
The attached PDF is a conversion of this title from Gutenberg Australia (an excerpt, actually):
https://gutenberg.net.au/epub-ebooks...%20Orwell.epub
I couldn't figure out how to call the section name and page numbers in the svg, but perhaps Jellby over at the
Prince plugin thread can give some insight.
By using
Code:
content: string(chaptertitle);
content: counter(page) "/" counter(pages);
...in the CSS, those elements can be displayed, however they end up being selectable.
Hope this helps!