Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-01-2019, 10:21 AM   #106
Julie34
Enthusiast
Julie34 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Oct 2017
Location: where is my heart
Device: Kobo Glo, and...
Many thanks for this plug-in. It works fine, even with very big files (I converted today a book: 1185 pages on Prince PDF, 453 notes: perfect conversion). Some kick small changes with Foxit PhantomPdf (full page image for front page, open full screen, and so on).
A small problem however. At the end of an epub3, there is a table of content. And the characters on Prince table become really to big. I do 18 pt for body (PDF to be readen on small screens). The configuration I use (could be certainly better but works):

Code:
@font-face {
  font-family: serif;
  src: local("Droid Serif")
}
*/

@page {
  size: 9cm 12cm;
  margin: 5mm 1mm 1mm 1mm !important;
  @top-left {
    font-size: 30%;
    font-style: italic;
    border-bottom: solid thin black;
    margin-bottom: 1mm;
    content: string(booktitle);
  }
  @top-center {
    font-size: 40%;
    font-style: italic;
    border-bottom: solid thin black;
    margin-bottom: 1mm;
    content: string(chaptertitle);
  }
  @top-right {
    font-size: 30%;
    border-bottom: solid thin black;
    margin-bottom: 1mm;
    content: counter(page) "/" counter(pages);
  }
}

@page:first {
  margin: 1mm 1mm 1mm 1mm;
  @top-left {
    border-width: 0;
    margin: 0;
    content: normal;
  }
  @top-center {
    border-width: 0;
    margin: 0;
    content: normal;
  }
  @top-right {
    border-width: 0;
    margin: 0;
    content: normal;
  }
}

body {
  font-size: 18pt;
  font-family: Amasis30;
  text-align: justify;
  prince-image-resolution: 166dpi;
  hyphens: auto;
  string-set: booktitle "@{@{title}@}@" author "@{@{author}@}@";
}
For the table, I get: PXAAB+Amasis30 (Embeded), 18 pt characters and it is really too big!
I do not succeed to correct it, except manually on Foxit (but it is fastidious).
Any possibility to adapt my (clumsy) configuration ?
Thanks.

Last edited by Jellby; 03-11-2019 at 03:25 PM.
Julie34 is offline   Reply With Quote
Old 03-11-2019, 03:25 PM   #107
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Can you share a sample epub file?
Jellby is offline   Reply With Quote
Old 03-15-2019, 04:47 AM   #108
Julie34
Enthusiast
Julie34 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Oct 2017
Location: where is my heart
Device: Kobo Glo, and...
Thank you for your answer. I sent you sample file by private message,
Julie34 is offline   Reply With Quote
Old 03-16-2019, 06:06 AM   #109
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I don't know why the TOC comes out so big, must be some default style of Prince. You can add something like this to the stylesheet:

Code:
body.nomargin {
  page: cover;
}

@page cover {
  size: 565px 799px !important; /* hard-coded cover image size */
  margin: 0 -117px !important;  /* make virtual page width 800px */
}

nav * {
  font-size: 100%;
}
  
nav > ol {
  font-size: 75%;
}

nav ol {
  margin-left: 2em;
}

nav#landmarks {
  display: none;
}
Jellby is offline   Reply With Quote
Old 03-16-2019, 09:31 AM   #110
Julie34
Enthusiast
Julie34 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Oct 2017
Location: where is my heart
Device: Kobo Glo, and...
Many thanks for the add to the style-sheet.

Works fine !
Specially for the TOC.

For the page cover, if you write :

@page cover
{ size: ...

it define the size of the cover page, but not of the image : I got a 565 x 799 page with a small image and normal pages after.
I tried "cover-size:" I does not work (you may write differents value with no change) but you get a no margin image up and down with small lateral margins (because of the image proportions, I suppose). Easely corrected.
(I put your code add at the end of the style-sheet : correct ?).
A last information : I do my epub3 with epub3itizer Sigil plug-in, as my prefered (but old) epub-converter does epub2 only. That is the moment the TOC table is added.
Thank you !
Julie34 is offline   Reply With Quote
Old 03-17-2019, 04:24 AM   #111
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Julie34 View Post
For the page cover, if you write :

@page cover
{ size: ...

it define the size of the cover page, but not of the image : I got a 565 x 799 page with a small image and normal pages after.
Right, the particular epub I tried it with had a 565x799 cover. If you want to use this, you should adapt it for the specific cover size of each epub. If it is X pixels wide and Y pixels high:

Code:
@page cover {
  size: Xpx Ypx !important;
  margin: 0 -(Y-X)/2px !important;
}
That is the best I could come up with after some trial and error, due to the way Prince is scaling images. (This was some time ago, it may have changed in the latest Prince version.) You can of course use different units or scaling factor, but it's important that the relative values are as above.[/QUOTE]
Jellby is offline   Reply With Quote
Old 03-17-2019, 10:28 AM   #112
Julie34
Enthusiast
Julie34 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Oct 2017
Location: where is my heart
Device: Kobo Glo, and...
Thank you for your answer.

Anyway, your code add is real improvement, thanks a lot, as my problem was vith the TOC table.
For the cover, (all my cover images are 565 x 799) I prefer to have the first page the same size of the rest of the PDF and with your code (without @page cover {size...) the image I get is almost perfect (much than before). Just a very small adaptation to enlarge it to the page size (as anyway I do "open full page" and supress the eventual automatic caesura in the title wih FoxitPDF).

Anyway I greatly appreciate this (almost) one click conversion to PDF with Prince PDF. Great job! and Thank you!
Julie34 is offline   Reply With Quote
Old 02-27-2020, 06:48 PM   #113
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

The free version for personal use of Prince reached 13.3. I installed it on my Linux box and, reading its user book, I realized it had some nice new features. Among them, two seem to be particularly interesting for ebook-readers.

inpage footnotes

I've seen that you can insert a span wiht "fn" class, add some CSS marking for footnote-call and marker and enjoy inpage footnotes. However, I do not know how to convert an ePub3 footnote code to be used by Prince...

open-type features.

I've read these comments:
Quote:
OpenType Features in Prince

Prince supports OpenType features, and enables certain ones by default in specific scripts. The following ones are enabled by default in Prince:
Script Enabled features
Latin, Greek, Cyrillic ccmp, liga, dist, kern*, mark, mkmk, vrt2/vert
Arabic/Syriac ccmp, rlig, calt, liga, mset, isol, medi, fina, kern, curs, mark, mkmk
Indic ccmp, and many other Indic-specific substitutions
Other scripts kern*, mark, mkmk

* Kerning can be disabled with the keyword prince-no-kerning of the font-variant property.

Microsoft has a list of the OpenType feature names here.

It is possible to enable other OpenType features by using the font-variant CSS property with the prince-opentype() function (see CSS Functional Expressions).

Care must be taken in which order the features are enabled! And please note that enabling one feature will disable all the default features.
However, I fail how to understand how I could use them with my ePub3.
I am most interested with font-variant-numeric (for oldnum) and font-variant-ligatures (for hlig) which can be added to ePub with a no-problem fallback. I still plan to use my own font for smcp.

Thank you for any help or explanation on how to implement these features.

Last edited by roger64; 02-28-2020 at 08:19 AM.
roger64 is offline   Reply With Quote
Old 02-28-2020, 12:34 PM   #114
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by roger64 View Post
inpage footnotes

I've seen that you can insert a span wiht "fn" class, add some CSS marking for footnote-call and marker and enjoy inpage footnotes. However, I do not know how to convert an ePub3 footnote code to be used by Prince...
Is this new? I think "float: footnote" has been a feature for some time.

As for converting an endnote (I don't know about ePub3) to footnote, last time I tried it didn't work very well. I could manage something by copying the content of an element somewhere else (there is some CSS function in Prince for that), but it didn't copy the styling, so anything beyond plain text in a footnote got lost.

Quote:
open-type features.

However, I fail how to understand how I could use them with my ePub3.
I am most interested with font-variant-numeric (for oldnum) and font-variant-ligatures (for hlig) which can be added to ePub with a no-problem fallback. I still plan to use my own font for smcp.
Does this help? https://www.princexml.com/doc/ligatures/#ligatures

I don't know if Prince supports font-variant-numeric and font-variant-ligatures, what the documentation seems to say is that you can have:

Code:
font-variant: prince-opentype(ccmp, liga, onum, hlig);
Jellby is offline   Reply With Quote
Old 02-28-2020, 07:50 PM   #115
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@Jellby

Thanks for your help. I jumped directly from v11 to v13.3.

Opentype features.I did not know how to do it and it's very easy to implement. The screenshot shows an old num (1847) and two historic ligs (one ct, one italic st) with a Prince PDF.

inpage footnotes, I probably misunderstood something. What I wished was to obtain, what we get with Koreader today with ePub3, that is inpage footnotes looking like the ones which are produced with the Prince float property but using the standard ePub3 code. So, probably, Prince is not yet there.
Attached Thumbnails
Click image for larger version

Name:	prince.png
Views:	584
Size:	56.9 KB
ID:	177431  

Last edited by roger64; 02-28-2020 at 07:54 PM.
roger64 is offline   Reply With Quote
Old 03-15-2021, 12:21 PM   #116
ZsoltKa
Junior Member
ZsoltKa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2021
Device: none
EPUB to PDF with Prince PDF help needed

Hello!

I'm trying to convert a book in EPUB format to PDF with the Prince PDF plugin.
The conversion works fine but the plugin does not recognises the TOC (toc.ncx) inside the EPUB file because the generated PDF bookmarks are not indented (no parent child bookmarks). Also - I think - because of this, some links are not working in the generated PDF table of contents.
How do I make Prince PDF so it will recognize and read the EPUB TOC file.

ZsoltKa is offline   Reply With Quote
Old 03-15-2021, 05:11 PM   #117
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,789
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by ZsoltKa View Post
Hello!

I'm trying to convert a book in EPUB format to PDF with the Prince PDF plugin.
The conversion works fine but the plugin does not recognises the TOC (toc.ncx) inside the EPUB file because the generated PDF bookmarks are not indented (no parent child bookmarks). Also - I think - because of this, some links are not working in the generated PDF table of contents.
How do I make Prince PDF so it will recognize and read the EPUB TOC file.

Moderator Notice

I moved this to the plugin's thread - the developer is more likely to watch it than the Conversion sub-forum

BR
BetterRed is offline   Reply With Quote
Old 03-16-2021, 11:42 AM   #118
ZsoltKa
Junior Member
ZsoltKa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2021
Device: none
Quote:
Originally Posted by BetterRed View Post

I moved this to the plugin's thread - the developer is more likely to watch it than the Conversion sub-forum

BR
Thanks! I actually wanted to write to this thread but it was already closed.
ZsoltKa is offline   Reply With Quote
Old 03-16-2021, 03:13 PM   #119
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by ZsoltKa View Post
How do I make Prince PDF so it will recognize and read the EPUB TOC file.
The plugin does not read the NCX file. The PDF toc is generated by Prince from the HTML contents. I'm not sure Prince can use any external file for a toc, probably not.

What you can do is add CSS code to let Prince create a reasonable TOC. Something like:

Code:
h1 {
  prince-bookmark-level: 1;
  prince-bookmark-label: content();
}
h2 {
  prince-bookmark-level: 2;
}
See https://www.princexml.com/doc/10/pdf-bookmarks/
Jellby is offline   Reply With Quote
Old 03-16-2021, 04:46 PM   #120
ZsoltKa
Junior Member
ZsoltKa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2021
Device: none
I see.
I saw that the EPUB toc file is essentially an xml file. Can be implemented so the plugin will parse that file and use it to generate the PDF?

I don't know how Calibre does, but in the log file I see Calibre uses the EPUB toc file also. But I don't know how is that done/implemented.
ZsoltKa is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 527 08-15-2025 01:36 PM
[GUI Plugin] EpubMerge JimmXinu Plugins 560 06-09-2025 03:46 PM
[GUI Plugin] Ex Libris AlPe Plugins 87 10-10-2020 03:10 PM
[GUI Plugin] Wordpress frescogamba Plugins 11 04-06-2015 09:09 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 03:10 PM.


MobileRead.com is a privately owned, operated and funded community.