Make Epub Great Again!
I love Epub more than PDF, but I found due to the generation method difference most Epub files cannot pass EpubCheck, some even cannot work with some readers.
So I made this project to fix the common problems in EPUB files, and make them more comply with standard.
The standard I follow is the latest Epub 3 standard, which currently is 3.3. Although you can supply with --epubVer=2 to avoid upgrading Epub 2 to 3, but this project is not designed to output Epub 2 compatible file as this flag only disable some sanitization which is only required since Epub 3. PR for better Epub 2 is welcome, but is not my current focus.
EpubSanitizerCore is the core library provides the sanitization logic. You can add it to your project and call it in your project.
EpubSanitizerCLI is the command line tool to use the core library. It's more user friendly and can be used directly.
EpubSanitizerCLI -h to see the help message.
Since usage may varies across versions, please refer to the help message for the specific version you are using.
Add EpubSanitizerCore to your project, then you can use the EpubSanitizer class to sanitize EPUB files.
You can refer to the EpubSanitizerCLI project for usage examples.
EpubSanitizer now provides a web version that can be accessed at EpubSanitizer Web.
This version contains the same functionality as the desktop version, allowing users to sanitize EPUB files directly in their web browser, but without customization options.
This project is licensed under the AGPL-v3.0 License or Qinlili Universal License.
You can choose either of them, or contact Qinlili to get an unlimited commercial license without any restriction.
There is some little difference for Free and Pro version on CLI.
| Features | Free Version | Pro Version |
|---|---|---|
| All filters for Epub with all options | ✅ | ✅ |
| Process unlimited files | ✅ | ✅ |
| Latest version available | ✅ | ✅ |
| Community support | ✅ | ✅ |
| Commercial usage | ✅ | ✅ |
| Embed in your project | ✅ | ✅ |
| ReadyToRun acceleration | ❌ | ✅ |
| Random exit code | ✅ | ❌ |
| Black both console text and background at night | ✅ | ❌ |
| Support HarmonyOS NEXT | ❌ | ❌ |
You can get Pro version CLI by any of these methods:
- Become a sponsor on GitHub/Buy Me a Coffee/爱发电
- Mutual follow with Qinlili on any platform
- Shopping on Amazon through Qinlili's Affiliate Link
- Download from Ctfile for free (with ads on download page)
- Submit your art to QinliliGallery as illustrator and authorize Qinlili to use with Qinlili Universal License
- Write articles or make videos on social media to promote any project made by Qinlili
- Compile your own version from source code
- Crack from Free version (There will never be any anti-cracking protection, I'm DRM-Free enthusiast)
If you call core library in your project there is no version difference.
Since 1.4.0, EpubSanitizer now supports plugins for additional features. Plugins are used for filters with external dependencies, in order to keep the core library can be lightweight.
Plugins are disabled by default and you need to enable them manually. This is designed for security concerns, as for maximum flexibility there is no restriction on what plugins can do. You should only use plugins when you know what you want to do and ensure the plugins come from trusted source.
In CLI version, you can enable plugins by passing --enablePlugins to enable all supported plugins. In core library, you can call PluginManager.EnablePlugin to enable specific plugins or PluginManager.EnablePlugins to enable all supported plugins.
Plugins should be put in the same folder of core library or CLI executable. Due to .NET limitation of InternalsVisibleTo, supported plugins are hardcoded in core library. So if you want to add your own plugin, you need to modify the core library source code, or use DemoPlugin name without modifying core library for testing purpose. You can refer to DemoPlugin project to see how to make a plugin.
There is a project BuildAllPlugins, after modifying plugin source code, build this project will copy all built plugins to CLI output folder.
This project will never add features that removing DRM or other copyright protection. We only focus on fixing problems in Epub files with no DRM.
If you want to report an issue about specific Epub file, please ensure it's legal to share the file in public.
Contributions are welcome! Feel free to open issues or pull requests.
Please ensure your contributions comply with the project's license.
Thanks to these projects for their inspiration and support: