Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2012, 01:22 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Inserting com.apple.ibooks.display-options.xml file in EPUB

Hi

I produce EPUB with embedded fonts. According to our MR wiki, if I wish iBooks to use my "specified fonts", I need to add to META-INF a com.apple.ibooks.display-options.xml file with the following text.

Spoiler:

<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>


I would like to know what is the simplest and easiest way to do it. What I tried (which failed) is:
- rename epub to zip and extract here.
- open META-INF and add the com.apple.ibooks.display-options.xml file
- create a new folder. Name it.
- insert the new META-INF folder (with the new file)
- insert mime and OEBPS folders
- compress to zip
- rename to EPUB.

Easy to do but, it does not work. Something in the above process is wrong and the newly created EPUB can't be opened.

PS: XML processing instructions in all my EPUBs begin with:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
I do not know if this may conflict with the new com.apple file.

Last edited by roger64; 09-30-2012 at 01:34 AM.
roger64 is offline   Reply With Quote
Old 09-30-2012, 02:47 AM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,846
Karma: 4565721
Join Date: Dec 2010
Device: Kindle PW2
On my Windows machine the following steps worked:

1. Rename .epub to .zip.
2. Double-click the .zip file to open it
3. Drag & drop the .xml file to the META-INF folder.
4. Close the Explorer window that shows the contents of the .zip file.
5. Rename .zip to .epub.

The resulting file with pass epubcheck.
Doitsu is offline   Reply With Quote
Old 09-30-2012, 03:22 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Thank you. This works and it's simpler.
roger64 is offline   Reply With Quote
Old 02-23-2013, 11:35 PM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Hi

I tried it today on some files using an Epubcheck 3 validation. It does not work anymore: I get this message. FlightCrew does not care about this.

Code:
Epubcheck Version 3.0

ERROR: À grandes guides v2.epub: Length of the first filename in archive must be 8, but was 45
Validating against EPUB version 2.0

Check finished with warnings or errors
Note: using Linux.
roger64 is offline   Reply With Quote
Old 02-24-2013, 12:04 AM   #5
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 248
Karma: 556004
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
The first file in the archive must be the mimetype file. If it isn't, it won't pass validation. Also, that file must be stored uncompressed (in theory, anyway), and the directories themselves must not appear as separate entries, IIRC.

Getting this right usually requires either a command-line tool or an app that knows how to do it. For example, in OS X, you can usually get away with

Code:
cd folder_containing_extraction
zip -Xr9D ../filename.epub mimetype * -x .DS_Store
dgatwood is offline   Reply With Quote
Old 02-24-2013, 05:55 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,745
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
With an existing, pre-validated epub, I do something similar to doitsu, but I use 7zip: open the archive in 7zip (no need to rename epub to zip) and drag the xml file into the META-INF folder. Of course if the mimetype file isn't already properly first and uncompressed, it's all moot anyway.
DiapDealer is online now   Reply With Quote
Old 02-24-2013, 07:29 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by DiapDealer View Post
With an existing, pre-validated epub, I do something similar to doitsu, but I use 7zip: open the archive in 7zip (no need to rename epub to zip) and drag the xml file into the META-INF folder. Of course if the mimetype file isn't already properly first and uncompressed, it's all moot anyway.
I do not understand your last words.

I take a clean EPUB (see lower down)

Code:
Epubcheck Version 3.0

Validating against EPUB version 2.0
No errors or warnings detected.
Open it with 7-zip (1), open META-INF (2), insert the file (3),

Epubcheck is angry:
Code:
Epubcheck Version 3.0

ERROR: Brochette de cœurs v2.epub: Length of the first filename in archive must be 8, but was 45
Validating against EPUB version 2.0

Check finished with warnings or errors
Of course, why this file goes from 500k (properties) to 800k (screen 1) is another mystery...
Attached Thumbnails
Click image for larger version

Name:	screen1.png
Views:	95
Size:	32.3 KB
ID:	101855   Click image for larger version

Name:	screen2.png
Views:	87
Size:	28.0 KB
ID:	101856   Click image for larger version

Name:	screen3.png
Views:	83
Size:	34.2 KB
ID:	101857  
Attached Files
File Type: epub Brochette de cœurs v2.epub (534.2 KB, 63 views)

Last edited by roger64; 02-24-2013 at 07:49 AM.
roger64 is offline   Reply With Quote
Old 02-24-2013, 07:52 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,953
Karma: 4346919
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
It seems 7z has inserted the file first (the string "META-INF/com.apple.ibooks.display-options.xml" is 45 char long), which means that it's not a good way of modifying epubs. Or maybe there's some setting you can change.
Jellby is online now   Reply With Quote
Old 02-24-2013, 08:07 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,745
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You're absolutely right. I never notice the issue before. It appears that 7-zip (at least this version of it) is rearranging the archive a bit rather than just adding the file.

The Tweak Book feature of calibre would be my suggestion in that case. No conversion necessary to do that. 1) Explode the ePub. 2) copy the the xml file to META-INF. 3) Rebuild the book.

I just verified that the above process keeps Epubcheck happy. It's unfortunate that there's not a less convoluted way for adding this file to ePubs--for users on platforms other than OS X, that is. The situation seems ripe for a "tool/addon."

Last edited by DiapDealer; 02-24-2013 at 08:28 AM.
DiapDealer is online now   Reply With Quote
Old 02-24-2013, 08:10 AM   #10
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by Jellby View Post
It seems 7z has inserted the file first (the string "META-INF/com.apple.ibooks.display-options.xml" is 45 char long), which means that it's not a good way of modifying epubs. Or maybe there's some setting you can change.
I am keen to learn. calibre seems to be a little overkill, but if there is nothing else.

Last edited by roger64; 02-24-2013 at 08:15 AM.
roger64 is offline   Reply With Quote
Old 02-24-2013, 08:30 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,953
Karma: 4346919
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Well, chances are a different program like WinZip or WinRar may behave better. Or maybe you can use 7-zip through the command line.

But it seems it doesn't work with the command line either:
http://sourceforge.net/p/sevenzip/fe...requests/1055/
Jellby is online now   Reply With Quote
Old 02-24-2013, 10:51 AM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,859
Karma: 2623257
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
You could also use ePUBpack, there is a links somewhere on the forum.
Toxaris is offline   Reply With Quote
Old 02-24-2013, 06:38 PM   #13
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,399
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by Toxaris View Post
You could also use ePUBpack, there is a links somewhere on the forum.
I'll try it, though it does not work with Wine (a pity for a GPL tool). At least it's considerably lighter than calibre for this purpose.

If somebody can explain, I've noticed this on a commercial EPUB:

- When you extract the files which are included in the zip (a former epub renamed zip), the com.apple.ibooks.display-options.xml file is included as usual close to the container.xml file in the META-INF folder.

- BUT, it appears alone within a Misc folder when you open the EPUB with Sigil.


Last edited by roger64; 02-24-2013 at 06:40 PM.
roger64 is offline   Reply With Quote
Old 02-24-2013, 06:42 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 36,087
Karma: 17100000
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
I do use WinRAR and yes, you can add files to an ePub without messing up the structure. So you could add the XML and it would not cause a problem.
JSWolf is offline   Reply With Quote
Old 02-24-2013, 06:43 PM   #15
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,745
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
If somebody can explain, I've noticed this on a commercial EPUB:

- When you extract the files which are included in the zip (a former epub renamed zip), this apple xml file is included as usual close to container.xml file in the META-INF folder.

- BUT, it appears within a Misc folder when you open the EPUB with Sigil.

That's "expected" behavior. It just appears to be in the 'Misc' folder when open in Sigil. Just part of whatever it is Sigil has to do to "ignore" that file. It definitely stays in the META-INF folder after you close/save the ePub though. Not to worry.
DiapDealer is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 11:40 AM.


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