Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-09-2020, 02:42 PM   #31
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,795
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Terry Brown View Post
Is there something else I need to do to make the page numbers show up?
AFAIK, printed page numbers only work in epub3 books. If your book is an epub2 book, you'll have to convert it to an epub3 book with the ePub3-itizer plugin.

If your book is an epub3 book, maybe the pagelist section in the Nav doc is missing, doesn't contain pagelist entries or the page number definitions point to the wrong target ids.

You might want to check your book with my EPUBCheck plugin, if you haven't already done so.

If EPUBCheck doesn't report any broken links, download this very simple MR epub3 book with a working pagelist section and compare the pagelist section and the page target definitions with your book.
Doitsu is offline   Reply With Quote
Old 07-01-2021, 04:23 PM   #32
tastytea
Junior Member
tastytea has learned how to buy an e-book online
 
tastytea's Avatar
 
Posts: 4
Karma: 80
Join Date: Mar 2021
Device: PocketBook Touch HD 3
Hi, thanks for your plugin!
I have a book that records page numbers like this:
Code:
<span role="doc-pagebreak" id="pg_13" aria-label="13">
Changing PageList.json to:
Code:
{
  "tag": "span",
  "attribute": "role",
  "value": "doc-pagebreak"
}
did not suffice, I also had to change plugin.py like this:
Code:
diff --git a/plugin.py b/plugin.py
index 9bf6b68..26a6863 100644
--- a/plugin.py
+++ b/plugin.py
@@ -143,6 +143,8 @@ def run(bk):
             # title has priority over string
             if page_number.has_attr('title'):
                 title = page_number['title']
+            elif page_number.has_attr('aria-label'):
+                title = page_number['aria-label']
             else:
                 title = page_number.string
Could you add that to your plugin?
tastytea is offline   Reply With Quote
Old 07-01-2021, 05:18 PM   #33
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,795
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tastytea View Post
Could you add that to your plugin?
Thanks for the suggestion! I added the two lines to plugin.py and attached a new version to the first post.
Doitsu is offline   Reply With Quote
Old 05-21-2022, 11:49 AM   #34
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
Hello, I tried your plugin on an epub I have. The <pageList> section is getting added to the ncx file but is empty. Here is what is getting added to my ncx file (python modified slightly to match existing file indentation):

Code:
  <pageList>
    <navLabel>
      <text>Paper Edition Page Mapping</text>
    </navLabel>
  </pageList>
The ebook already had anchor tags present so I did not modify the json file. Here is an example page number from my ebook:

Code:
<span epub:type="pagebreak" title="Page_8" id="Page_8" class="page-number" xmlns:epub="http://www.idpf.org/2007/ops">Page 8</span>
The plugin is identifying page number targets in the file and has found over 900 targets. However, it is not writing out the details in the pageList.

Thoughts?
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 12:40 PM   #35
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,407
Karma: 6733754
Join Date: Nov 2009
Device: many
If epub3, the pagelist should be written to the nav.
KevinH is offline   Reply With Quote
Old 05-21-2022, 01:26 PM   #36
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,795
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by m8cb0y View Post
Hello, I tried your plugin on an epub I have. The <pageList> section is getting added to the ncx file but is empty. Here is what is getting added to my ncx file (python modified slightly to match existing file indentation):

Code:
  <pageList>
    <navLabel>
      <text>Paper Edition Page Mapping</text>
    </navLabel>
  </pageList>
I was able to reproduce the bug and'll release an updated version soon.
Doitsu is offline   Reply With Quote
Old 05-21-2022, 01:36 PM   #37
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
Quote:
Originally Posted by Doitsu View Post
I was able to reproduce the bug and'll release an updated version soon.
Thank you!

I can understand python just enough to recognize data structures and follow the logic, but only just. If I had more time I might be able to understand better what you are using. Probably would help better if I were more familiar with Python library functions
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 04:02 PM   #38
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
Quote:
Originally Posted by Doitsu View Post
I was able to reproduce the bug and'll release an updated version soon.
I just tested the updated plugin on my eBook, worked perfectly.

My ebook uses "Page_x" for its anchor points so I needed to do a quick find/replace in the <pageList> section to remove the "Page_" from the <text> tags.

Thank you so much
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 04:07 PM   #39
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,795
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
I've attached an updated plugin version to the first post.

However, since the plugin will use the title attribute value instead of the string value by default, it'll write the following page list entry to the NCX file:

Code:
<pageTarget id="Page_8" type="normal" value="Page_8">
	<navLabel>
		<text>Page_8</text>
	</navLabel>
	<content src="Text/Section0001.xhtml#Page_8"/>
</pageTarget>
If you want the plugin to write the string value instead, change the following lines:

Code:
            # title has priority over string
            if page_number.has_attr('title'):
                title = page_number['title']
            elif page_number.has_attr('aria-label'):
                title = page_number['aria-label']
            else:
                title = page_number.string
to:

Code:
            # title has priority over string
            title = page_number.string
(There need to be exactly 12 spaces before each line.)

BTW, page list entries in Epub2 NCX files are usually ignored by Epub2 apps. The plugin only adds them, because some some Calibre converters will use them.
(Epub3 apps only use the NAV pagelist entries.)
Doitsu is offline   Reply With Quote
Old 02-06-2026, 11:58 AM   #40
Morea
Member
Morea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting WindowsMorea format shifts faster than booting Windows
 
Posts: 10
Karma: 120100
Join Date: Sep 2021
Device: none
@Doitsu
Thank you for this great plugin! The proposed clip also works fine. Perhaps the clip in the example could be amended to fulfill W3C rules for accessibility, see https://www.w3.org/TR/epub-a11y-tech...geBreakMarkers

For example:
<span
id="page\1"
epub:type="pagebreak"
role="doc-pagebreak"
aria-label="1">
\1
</span>
Morea is offline   Reply With Quote
Old 02-19-2026, 12:57 PM   #41
Leilu
Enthusiast
Leilu began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Feb 2023
Device: Kindle Oasis 3 / Kobo Libra 2
Hi!

I’m having trouble retrieving page numbers in Sigil from a .docx or .odt file edited in LibreOffice. I’ve tried converting to EPUB using Pandoc, as well as the DOCXImport and ODTImport plugins for Sigil, but without success.
Leilu is offline   Reply With Quote
Old 02-19-2026, 01:09 PM   #42
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,135
Karma: 211348980
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Nothing in Sigil or in the DOCXImport plugin is going to make use of page numbers from a docx or odt document. I suspect the same is true for the ODTImport plugin. Nothing I know of will automatically bring page numbers from a docx/odt file into a Sigil epub. Of course having said this, someone will come along shortly to prove me wrong.
DiapDealer is offline   Reply With Quote
Old 02-19-2026, 01:30 PM   #43
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,407
Karma: 6733754
Join Date: Nov 2009
Device: many
And pagelists are typically only generated if a specific already published edition of the book is actually in print. Any page number in a LibreOffice or Word file is pretty meaningless as there would be no official public published book that would serve as the basis for them.

Pagelists are typically only important for academic citations to already published works.
KevinH is offline   Reply With Quote
Old 02-19-2026, 02:57 PM   #44
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,795
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
I suspect the same is true for the ODTImport plugin.
The plugin is using writer2xhtml for the conversion, which has several pagebreak settings documented in the user guide. You can enable the output of pagebreak targets in epub3 files by adding the following line to config.xml in the ODTImportQt plugin folder.

Code:
<option name="original_page_numbers" value="true" />
If you add this line and convert the linked .odt user manual with the ODTImportQt plugin, writer2xhtml will actually insert pagebreak markers with non-standard masterpage="Standard" attributes. But they seem to be off by one number. I.e., it says page 6 when it actually should say page 7 etc.
Doitsu is offline   Reply With Quote
Old 02-19-2026, 06:57 PM   #45
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,135
Karma: 211348980
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Gotcha. So it CAN be done with ODTImport... sort of. They just didn't configure the plugin to do it. I told you someone would prove me wrong! I was mainly wondering why Pandoc, and DOCXImport (not to mention this plugin) were being mentioned for the task.
DiapDealer is offline   Reply With Quote
Reply

Tags
pagelist, pagelist generator


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter Page Numbers Instead of Title Page Numbers TheArtfulDodger Devices 1 11-18-2013 02:08 PM
Kindle (AZW3/MOBI) ebooks with "real page numbers" to PDF with same page numbers? abvgd Conversion 2 05-24-2013 02:24 PM
Index containing page no. with links - <pagelist> problem mr10463 Sigil 7 05-21-2013 08:27 AM
Print page range in viewer outputs single empty page larzeb Library Management 2 04-30-2013 06:24 AM
Is there a hack for displaying page numbers rather than location numbers? nesler Kindle Developer's Corner 16 02-15-2011 01:00 AM


All times are GMT -4. The time now is 07:47 AM.


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