Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-14-2026, 02:29 PM   #1
wolpi
Junior Member
wolpi began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2015
Device: iPad2
Extracting text with ebook-convert: Confused about "pagebreak" option

Hello,

I am trying to extract the text from various ebook formats to corresponding ".txt" files, and want to preserve page/chapter breaks (ideally with the "Formfeed" control character)

I found "ebook-convert"s "--chapter-mark" option with the "pagebreak" parameter, but am unable to figure out from the documentation how this is intended to work and if it might do what I am trying to achieve.

When I run the command like

Code:
ebook-convert "~/Book.epub" "~/Book.txt" --chapter-mark pagebreak
the command output shows the chapters detected in the Book.epub file, but in the generated Book.txt I can find nothing that can be interpreted as a pagebreak indicator.

This is running Calibre 9.2.1 on macOS 15

Thanks!
wolpi is offline   Reply With Quote
Old 02-14-2026, 07:06 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,521
Karma: 62503986
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by wolpi View Post
Hello,

I am trying to extract the text from various ebook formats to corresponding ".txt" files, and want to preserve page/chapter breaks (ideally with the "Formfeed" control character)

I found "ebook-convert"s "--chapter-mark" option with the "pagebreak" parameter, but am unable to figure out from the documentation how this is intended to work and if it might do what I am trying to achieve.

When I run the command like

Code:
ebook-convert "~/Book.epub" "~/Book.txt" --chapter-mark pagebreak
the command output shows the chapters detected in the Book.epub file, but in the generated Book.txt I can find nothing that can be interpreted as a pagebreak indicator.

This is running Calibre 9.2.1 on macOS 15

Thanks!
Control auto-detection of document structure.
I believe this is for the Input (source)

You selected .txt as an output .

Quote:
The form feed character is a control character in ASCII and Unicode, historically used to tell printers to advance to the start of the next page.

Key Details:
ASCII Code: Decimal 12, Hex 0x0C, Unicode U+000C
Escape Sequence in C/Java/Python: \f
Purpose:
In printers: Moves the print head to the top of the next page.
In text files: Acts as a page break or section separator.
theducks is offline   Reply With Quote
Old 02-15-2026, 03:47 AM   #3
wolpi
Junior Member
wolpi began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2015
Device: iPad2
Quote:
Originally Posted by theducks View Post
Control auto-detection of document structure.
I believe this is for the Input (source)

You selected .txt as an output .
Thank you for the reply, but I do not understand what you are trying to tell me here

I am aware what the purpose of the form feed character is.

Currently, I am using the "textract" Python module to extract text from pdf and epub files. This separates the resulting text with page break characters, but supports fewer file formats than Calibre.
So I was hoping to substitute "textract" with functionality from "ebook-convert".
wolpi is offline   Reply With Quote
Old 02-15-2026, 09:25 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,998
Karma: 29579720
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The txt format does not have page or chapter break indicators. Convert to EPUB or similar and you will see the break indicators.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook-convert error: "no such option: --epub-version" py_make_book Conversion 3 01-18-2025 11:17 AM
"Edit bookmark text" option ichnilatis KOReader 2 02-19-2023 07:24 AM
Forma When I long-tap on some text, I want to immediately get option to "Search in Book" droopy Kobo Developer's Corner 3 07-05-2020 03:15 AM
Classic "text settings" option tuinebap88 Barnes & Noble NOOK 1 01-20-2011 12:58 AM
Zune eBook Creator (RTextAsImage) - "Convert" text to images oleg.shastitko Reading and Management 10 01-28-2008 02:18 PM


All times are GMT -4. The time now is 06:45 PM.


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