I created this batch file to compress my epub files into an epub.
It checks for an existing epub and deletes it.
It checks the current folder name and then simply creates a zip file with the same name. It then renames that .zip to a .epub
for %%a in (.) do set currentfolder=%%~na
del *.epub
7z a -tzip %currentfolder%.zip META-INF OPS mimetype
rename *.zip *.epub
However I do not pass validation with this epub file. http://validator.idpf.org/ gives me the following two errors that I need to fix.
1.How do I force the mimetype file to be the first in the archive?
2.How do I remove this thumbs.db, I can see it in the archive but i don't see it in Explorer?
Thank you in advance
Ferroao has the right idea, but it can be simplified:
cd "folder of epub content"
# add mimetype 1st
zip -0 -X ../file.epub mimetype
# add the rest
zip -9 -X -r -u ../file.epub *
The -u on the second command tells Zip to add only new/changed files, so it will skip mime type on the second pass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With