We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0
Document
outlines()
I'm trying to get table of content data of epub files with this code:
fn main() { use mupdf::{Document, Outline}; let doc: Document = Document::open("C:\\Users\\LazyGeniusMan\\Downloads\\mupdf\\test.epub").unwrap(); let toc: Vec<Outline> = doc.outlines().unwrap(); for i in toc { println!("{:#?}", i) } }
but the output of the page is always 0 like this:
Outline { title: "Cover", uri: None, page: Some( 0, ), down: [], x: 0.0, y: 0.0, }, ... Outline { title: "5 Centimeters per Second", uri: None, page: Some( 0, ), down: [ Outline { title: "Chapter One: Tale of Cherry Blossoms", uri: None, page: Some( 0, ), down: [], x: 0.0, y: 0.0, } ... ... }
But when I try using PyMuPDF in python with this code:
PyMuPDF
import fitz doc = fitz.Document('C:\\Users\\LazyGeniusMan\\Downloads\\mupdf\\test.epub') toc = doc.get_toc() for i in toc: print(i)
it can show the correct page number index with format [level, title, page number] like this:
[level, title, page number]
[1, 'Cover', 1] [1, 'Title Page', 2] [1, 'Copyright', 3] [1, 'Table of Contents', 5] [1, '5 Centimeters per Second', 7] [2, 'Chapter One: Tale of Cherry Blossoms', 8] [2, 'Chapter Two: Cosmonaut', 28] [2, 'Chapter Three: 5 Centimeters per Second', 50] [2, 'Afterword', 79] [2, 'Essay', 81] [1, 'Children Who Chase Lost Voices', 84] [2, 'Chapter One', 85] [2, 'Chapter Two', 91] [2, 'Chapter Three', 98] [2, 'Chapter Four', 101] [2, 'Chapter Five', 116] [2, 'Chapter Six', 124] [2, 'Chapter Seven', 131] [2, 'Chapter Eight', 140] [2, 'Chapter Nine', 144] [2, 'Chapter Ten', 150] [2, 'Chapter Eleven', 157] [2, 'Chapter Twelve', 160] [2, 'Chapter Thirteen', 169] [2, 'Afterword', 172] [1, 'Yen Newsletter', 174]
The text was updated successfully, but these errors were encountered:
Sorry, this project is not actively maintained at the moment, but I'm happy to accept pull requests to fix this if anyone is up for it.
Sorry, something went wrong.
No branches or pull requests
I'm trying to get table of content data of epub files with this code:
but the output of the page is always
0
like this:But when I try using
PyMuPDF
in python with this code:it can show the correct page number index with format
[level, title, page number]
like this:The text was updated successfully, but these errors were encountered: