Mobileread
Kobo future firmware feature request thread
#1831  compurandom 06-08-2020, 08:35 AM
Quote JSWolf
Install the epubcheck plugin. Load the ePub in the Calibre editor. Use the editor's checker and epubcheck to check all the ePub. Then you can use the editor to fix the errors.

As for removing javascript, install the Modify ePub plugin to dump all javascript.
Most epubs don't need any changes to work well except maybe metadata tweaks and a cover update.

A small handful of epubs have issues and I typically use modify epub to remove javascript as suggested above, or have to go into the editor and remove web browser or printer specific style sheets that work poorly on ereaders, and sometimes remove more javascript that modify epub somehow missed.

And very very rarely, I have an epub that's just so bloated and messed up that epub->epub conversion fixes. These are usually ones with exceptionally long chapters that need splitting or some kind of wierdness in the TOC or a TOC that is too deeply nested and I just want to reduce the levels or something.

And occasionally I use the TOC editor in calibre for a quick fix rather than the epub converter or the toc editor in the epub editor.

As to doing it on all the epubs in a library -- it's usually only a small handful that need anything but basic tweaks anyway. If you've got a huge number of epubs that are malformed, I be they're all from the same source with the same issues and it might be worth writing a source specific tool or workflow to fix them.
Reply 

#1832  JSWolf 06-08-2020, 10:22 AM
Quote compurandom
Most epubs don't need any changes to work well except maybe metadata tweaks and a cover update.
But all it takes is one that does need fixing to cause problems. AndI have seen some retail ePub that fails epubcheck.
Reply 

#1833  droopy 06-08-2020, 03:48 PM
Quote DNSB
You can run epubcheck from the command prompt and with a little batch file work, you can check all those books in one go. One rather long go⁠—epubcheck is not a speedy program.

I have a directory called epubcheck on my desktop with the batch file and epubcheck.jar plus epubcheck's lib directory The for loop scans through the directory (in this case %USERPROFILE\calibre\Intake points to my calibre intake library) returning any .epub files. The batch file echos the path/filename for the epub and any messages from epubcheck to a file called epubcheck.txt. The echo is needed since otherwise all I would see for an error-free file would the 3 lines telling me no errors were found. The "s around the %%f keeps me from having issues with spaces in the filepath/name string.

I saved the below to a file called checkepub.cmd

Code
for /R %USERPROFILE%\calibre\Intake %%f in (*.epub) do (
echo "%%f" 1>>%USERPROFILE%\Desktop\epubcheck\epubcheck.txt 2>&1
java -jar epubcheck.jar "%%f" 1>>%USERPROFILE%\Desktop\epubcheck\epubcheck.txt 2>&1
)
pause
A quick scan through epubcheck.txt looking for "Check finished with errors" locates the error files.
Spoiler Warning below







Code
"C:\Users\David\calibre\Intake\Dave Heiland\Sigil User Guide (6734)\Sigil User Guide - Dave Heiland.epub"
Validating using EPUB version 2.0.1 rules.
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(47,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(53,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(59,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(65,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(71,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(77,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
ERROR(RSC-005): C:/Users/David/calibre/Intake/Dave Heiland/Sigil User Guide (6734)/Sigil User Guide - Dave Heiland.epub/OEBPS/Text/validation.html(83,9): Error while parsing file: element "ul" not allowed here; expected the element end-tag or element "li"
Check finished with errors
Messages: 0 fatals / 7 errors / 0 warnings / 0 infos
EPUBCheck completed
"C:\Users\David\calibre\Intake\J. K. Rowling\The Ickabog (9199)\The Ickabog - J. K. Rowling.epub"
Validating using EPUB version 2.0.1 rules.
No errors or warnings detected.
Messages: 0 fatals / 0 errors / 0 warnings / 0 infos
Thanks, David/DNSB.
Does anybody know how to run that in Linux?
Reply 

#1834  j.p.s 06-08-2020, 04:21 PM
Code
#!/bin/bash
for f in *.epub do echo "$f" >> epubcheck.txt echo "$f" >> epubcheck.err java -jar epubcheck.jar "$f" >> epubcheck.txt 2>> epubcheck.err
done
Reply 

#1835  droopy 06-08-2020, 05:54 PM
Quote j.p.s
Code
#!/bin/bash
for f in *.epub do echo "$f" >> epubcheck.txt echo "$f" >> epubcheck.err java -jar epubcheck.jar "$f" >> epubcheck.txt 2>> epubcheck.err
done
should I first go to folder containing the the calibre database/library?
Reply 

#1836  j.p.s 06-08-2020, 07:44 PM
The script assumes that all the epub files are in the same directory and that you are in it.

To check all the epubs in your Calibre Library, you need to cd there, and also change
for f in *.epub do
to
for f in */*/*.epub do
because each book has its own directory in each author's own directory.

If you want to runn from any directory, you need to prepend the full path to your Claibre library to */*/*.epub

Be sure to escape or quote any evil embedded spaces in that path.

(All spaces embedded in file names are evil.)
Reply 

#1837  Fpaiy 06-29-2020, 07:27 AM
Currently, by default for PDF the zoom percentage is 100 percent and position at the centre every time we turn to next page.

We have to zoom and adjust position every time we turn to the next page. Since most book have standard white margin and page number throughout the whole book. We can adjust once at the start to our preference and apply all pages instead of adjusting on every page.

It would be great to set the position and zoom percentage for the whole book at the start to apply to the whole PDF book. So every page turn will have the zoom percentage and position in place.
Reply 

#1838  vinhphucng25 07-16-2020, 10:38 AM
Please don't ask connect every time I plug it to PC because I just wanna connect to PC all the time I connect.
Reply 

#1839  geek1011 07-16-2020, 10:49 AM
Quote vinhphucng25
Please don't ask connect every time I plug it to PC because I just wanna connect to PC all the time I connect.
There's a config option for that: [DeveloperSettings] AutoUsbGadget
Reply 

#1840  twowheels 07-16-2020, 12:07 PM
Quote geek1011
There's a config option for that: [DeveloperSettings] AutoUsbGadget
But I have to click it one more time to be able to set that!


Thanks... I think I'll toggle that one too.

EDIT: It would be irresponsible of me to not point out that there is an inherent security risk here, if you care. If you happen to use a public charger that happens to be a data stealing device, then it can auto-connect and copy everything off of your reader, including all of your API access tokens for Pocket, the Kobo store, etc. In general, if you're plugging into strange USB ports, you should use a charge-only cable without data pins connected, but having to confirm before connecting is actually a useful security feature.
Reply 

 « First  « Prev Next »  Last »  (184/185)
Today's Posts | Search this Thread | Login | Register