Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 05:17 PM   #1
Angius
Junior Member
Angius began at the beginning.
 
Angius's Avatar
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 11th gen
Post Need help figuring out what's wrong with an ePub I generated

I noticed a lack of an ePub generation library for .NET and decided to make one. I thought that I was creating the final file properly, and Calibre was able to open and display it without any issues, but my Kindle won't read it, and the online ePub validators I tried just mostly hang without showing any useful errors.

I hope that perhaps someone more knowledgable about the format would be able to dissect what I generated and point me toward's what's wrong.

The generated ebook is attached to the post, and in case you don't trust random files downloaded from the internet, you can find the source code of the generator here and run the Demo project (requires .NET 8 SDK) to generate the exact same file I attached here.
Attached Files
File Type: epub book.epub (5.8 KB, 5 views)
Angius is offline   Reply With Quote
Old Yesterday, 05:28 PM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,208
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
The epub is incomplete.
you have a single style in the css file being p
But the text in the html files have no p tags surrounding it. It is just raw text with no tags.
Karellen is offline   Reply With Quote
Advert
Old Yesterday, 05:29 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,413
Karma: 74317822
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Did you not see https://github.com/jonthysell/QuickEPUB ?

Additionally there is ePubCheck https://github.com/w3c/epubcheck?tab=readme-ov-file
PeterT is offline   Reply With Quote
Old Yesterday, 08:28 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 37,827
Karma: 150333332
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it is worth, I ran the epub through epubcheck and it came up with a list of 12 errors.
Some of them are trivial such as no <p></p> tags for text and the space before the first line in the ncx file.

Spoiler:
Code:
book.opf,N/A,N/A,Col: -1: ERROR(OPF-030): The unique-identifier ""BookId"" was not found.
book.opf,6,474,Col: 43: ERROR(OPF-054): Date value ""23.07.2024 23:09:36"" is not valid as per http://www.w3.org/TR/NOTE-datetime:Unexpected: ..
cover.jpg,N/A,N/A,Col: -1: ERROR(RSC-001): File ""cover.jpg"" could not be found.
chapter-1.html,10,256,"Col: 12: ERROR(RSC-005): Error while parsing file: element ""body"" incomplete; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
chapter-2.html,10,252,"Col: 12: ERROR(RSC-005): Error while parsing file: element ""body"" incomplete; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
chapter-3.html,10,251,"Col: 12: ERROR(RSC-005): Error while parsing file: element ""body"" incomplete; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
book.opf,7,488,Col: 14: ERROR(RSC-005): Error while parsing file: element ""metadata"" incomplete; missing required elements ""dc:identifier"" and ""dc:language""
title.html,7,319,Col: 16: ERROR(RSC-005): Error while parsing file: element ""style"" missing required attribute ""type""
chapter-1.html,9,244,"Col: 17: ERROR(RSC-005): Error while parsing file: text not allowed here; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
chapter-2.html,9,240,"Col: 14: ERROR(RSC-005): Error while parsing file: text not allowed here; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
chapter-3.html,9,239,"Col: 19: ERROR(RSC-005): Error while parsing file: text not allowed here; expected element ""address"", ""blockquote"", ""del"", ""div"", ""dl"", ""h1"", ""h2"", ""h3"", ""h4"", ""h5"", ""h6"", ""hr"", ""ins"", ""noscript"", ""ns:svg"", ""ol"", ""p"", ""pre"", ""script"", ""table"" or ""ul"" (with xmlns:ns=""http://www.w3.org/2000/svg"")"
book.ncx,1,6,Col: 7: FATAL(RSC-016): Fatal Error while parsing file: The processing instruction target matching ""[xX][mM][lL]"" is not allowed.


Please note that calibre's viewer is very forgiving. Most dedicated renderers are not forgiving. If your ePub fails epubcheck, most publishers will bounce it back to you to be fixed.

Last edited by DNSB; Yesterday at 08:32 PM.
DNSB is online now   Reply With Quote
Old Today, 02:39 AM   #5
Angius
Junior Member
Angius began at the beginning.
 
Angius's Avatar
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: Kindle Paperwhite 11th gen
Thanks for the answers! I did manage to fix my code, so it generates proper epubs now (at least according to EpubCheck)
Angius is offline   Reply With Quote
Advert
Reply

Tags
epub, generator, help needed, programming


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW3 5.12.3 Serial Jailbreak - generated root password is wrong texaspete Kindle Developer's Corner 2 07-27-2020 11:00 AM
Odd behavior with Pages generated ePub 1611mac Sigil 3 11-28-2011 02:53 PM
.Epub to .Mobi--duplicate chapters generated? JDawg Calibre 0 07-15-2011 08:50 PM
Covers in ePub files generated by Calibre daviddem Calibre 14 06-30-2011 09:18 PM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 09:59 AM


All times are GMT -4. The time now is 03:30 AM.


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