02-25-2013, 03:26 AM | #16 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
|
02-25-2013, 04:01 AM | #17 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Thanks to all of you. Last edited by roger64; 02-25-2013 at 04:04 AM. |
|
Advert | |
|
02-25-2013, 04:39 AM | #18 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
If you are on linux, it's best to just use the command-line zip, or maybe some front-end like ark, Xarchiver...
|
02-25-2013, 05:33 AM | #19 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
I also used GPRename (Linux) to batch rename files from epub to zip and back, which saved some time. If you have a command available for this, I'll be happy to try it next time. |
|
02-25-2013, 05:43 AM | #20 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
For renaming?
rename 's/.zip/.epub/' *e.zip (or with other versions of rename: rename .zip .epub .zip) |
Advert | |
|
02-25-2013, 05:56 AM | #21 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
No. Renaming was easy enough (see screenshot) though your solution is really nice.
I mean, opening the zip file (s), inserting the apple file in META, and back. |
02-25-2013, 06:21 AM | #22 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
zip file.epub META-INF/com.apple.ibooks.display-options.xml
It requires having the apple file in a META-INF directory, though. |
02-25-2013, 07:13 AM | #23 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Following what you said, I put the apple.xml file in a META-INF folder, alongside with two EPUBS (screenshot). I then tried the customary: Code:
roger@lmde64:~/Bureau/Test$ zip *.epub META-INF/com.apple.ibooks.display-options.xml updating: META-INF/com.apple.ibooks.display-options.xml (deflated 27%) adding: Cocardes et dentelles v2.epub (deflated 1%) roger@lmde64:~/Bureau/Test$ If I take away from the Test folder the first processed EPUB and then repeat the same command, the second EPUB is correctly processed. This can go quickly... Last edited by roger64; 02-25-2013 at 07:21 AM. |
|
02-25-2013, 07:40 AM | #24 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
zip file1.epub file2.epub apple.xml For what you want, you could use bash loops, which may look daunting, but it's really simple: Code:
for i in file1.epub file2.epub do zip "$i" apple.xml done Code:
for i in file1.epub file2.epub; do zip "$i" apple.xml; done |
|
02-25-2013, 08:10 AM | #25 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I am sorry to give you all this trouble.
I found that the first try was very convenient for my level of understanding (even then I did a mistake...) as it allows to process one EPUB at a time. Furthermore, as we can use again and again exactly the same command, it's easy to use. We just have to replace an EPUB with the next one. I'm afraid the "loop" thing is way beyond my capacity. I did not expect it to become so quickly so complex. Just writing long file names for the terminal (using antislashes and things like that) is a chore. So, I will keep myself at the first level. Thank you for your help, explanations and brilliant solution that, for sure, I will use next time... |
02-25-2013, 08:32 AM | #26 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
(that sometimes fails with exclamation marks, probably a bug in my bash version, just avoid exclamation marks). and you know you can use autocompletion too, don't you? Write the first few letters of the filename and press the TAB key, the filename will probably be completed (as far as it can be, without ambiguity) |
|
02-25-2013, 07:23 PM | #27 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
Just the time to sleep over it with a little nagging remorse for being lazy. OK, I must admit once again you're very right. I did a try with three EPUB and my META-INF folder and it works brilliantly. Once all the files were here, I used TAB to auto-complete. I had three EPUB with three filenames beginning with "La ". The terminal wrote every successive name with antislashes but who cares? Code:
roger@lmde64:~/Bureau/Test$ for i in La\ brune\ et\ la\ blonde\ v2.epub La\ grande\ fête\ v2.epub La\ main\ aux\ dames\ v2.epub; do zip "$i" META-INF/com.apple.ibooks.display-options.xml; done adding: META-INF/com.apple.ibooks.display-options.xml (deflated 27%) adding: META-INF/com.apple.ibooks.display-options.xml (deflated 27%) adding: META-INF/com.apple.ibooks.display-options.xml (deflated 27%) roger@lmde64:~/Bureau/Test$ Code:
for i in FILE; do zip "$i" META-INF/com.apple.ibooks.display-options.xml; done Last edited by roger64; 02-25-2013 at 07:54 PM. |
02-26-2013, 04:16 AM | #28 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
and... you can also use wildcards:
for i in *.epub; do zip ... |
02-26-2013, 11:30 PM | #29 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
Code:
mkdir ex cd ex unzip /path/to/file.epub [modify files here] zip -Xr9D ../file-edited.epub mimetype * -x .DS_Store Then repeat for the next book in a different directory. You can create only a single zip file per command. Everything after that is considered to be a file that you want to include *in* the output file. |
|
02-27-2013, 04:13 AM | #30 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Anyway, for the problem is here, which is adding a specific file to an existing ePub, creating one from scratch is a bit of an overkill... |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
com.apple.ibooks.display-options | brewt | Plugins | 5 | 09-06-2012 09:57 AM |
Presence of com.apple.ibooks.display-options.xml breaks Readium? | rtmyers | ePub | 2 | 08-18-2012 05:01 AM |
Apple's iBooks 2, iBooks Author: Bids to own publishing's future | wannabee | News | 0 | 01-19-2012 07:33 PM |
XML files and XSD file to EPUB | janneman | Workshop | 8 | 04-08-2011 05:23 PM |
ePub display issue in iBooks | Protagitron | ePub | 3 | 02-08-2011 01:38 PM |