View Single Post
Old 10-10-2024, 05:08 AM   #10
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,641
Karma: 7908443
Join Date: Sep 2020
Device: none
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 {
  
size17cm 33cm;
  
margin5mm 10mm 5mm 10mm !important;
    @
top-left {
    
font-size50%;
    
font-styleitalic;
    
border-bottomsolid thin black;
    
margin-bottom1mm;
    
content'';
    
displayblock;
    
width500px;
    
height50px;
    
background-imageurl('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-size500px 30px;
  }
  
  
   @
bottom-left {
    
font-size50%;
    
font-styleitalic;
    
border-topsolid thin black;
    
margin-bottom1mm;
    
content'';
    
displayblock;
    
width500px;
    
height50px;
    
background-imageurl('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-size500px 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!
Attached Files
File Type: pdf _Nineteen eighty-four - George Orwell_1_1.pdf (179.8 KB, 118 views)

Last edited by Comfy.n; 10-10-2024 at 05:12 AM.
Comfy.n is offline   Reply With Quote