View Full Version : OPF inside OEBPS folder - Obligatory or strongly recommended ??

06-15-2012, 10:22 AM
We work for publishers receiving and distributing their ePubs. I have a disagreement about a technical point with a coworker.

We received an ePub that has the opf directly at the root level and NOT inside the OEBPS folder, as almost every other ePub does.

PROBLEM is that we tried a software that watermarks ePubs but it doesn't work if you input an ePub for which the *.opf file is not inside the OEBPS. So :

epub.epub/OEBPS/content.opf <-- An epub like this works fine in the watermarking software

epub.epub/content.opf <-- An epub like this does not work when we use the watermarking software.

The second ePub DOES have a META-INF/container.xml that points to the OPF, using this code :

<rootfile full-path="content.opf" media-type="application/oebps-package+xml"/>

So our disagreement is :

Is it ok for the publisher to make such an ePub ???

We know it is "technically" correct, according to IDPF's standard.

One of us says the publisher should not contruct his ePubs this way, as he takes a risk that some software or devices show problems for this ePub and that we should tell him to put the *.opf inside OEBPS.

The other one says that it is ok for him to do like that and that the software SHOULD support such a construction, so the publisher is in his right to construct the ePubs in such a way.

What do you think ?

06-15-2012, 10:58 AM
I think the file can be wherever he wants. As far as I know all readers use the container file to find the OPF. Hard coding more than absolutely necessary is a bad idea.

Jeff L
06-15-2012, 11:43 AM
I've been fixing a bunch of Random House epubs and they all have the OPF at the root.

Many (all?) Penguin epubs, on the other hand, place the OPF in the subfolder.

06-15-2012, 11:52 AM
As long as the container.xml file contains the correct path to the OPF file... any decent reading system shouldn't really care where it is.

06-15-2012, 02:48 PM
I think you need to address the creator of the watermark software that it needs to work differently. They should honor the possibilities.

06-15-2012, 03:11 PM
We know it is "technically" correct, according to IDPF's standard.

You already know the answer, then ;) --- No serious (= professional and paid) product should impose arbitrary constraints.

BTW, I take the liberty of pointing you to my exlibris script: which might suit your needs.
( free software, both as in 'freedom' and as in 'free beer' :D )

06-15-2012, 03:12 PM
META-INF/container.xml must point to the correct location of the OPF file (which can have any name and be located anywhere). The location specified in container.xml is relative to the root directory of the epub (i.e., not to the location of container.xml itself, which must me META-INF)

The OPF file must have a manifest of the other files in the epub, and the locations there must be relative to where the OPF is located. So, if everything is inside OEBPS, then the "hrefs" in the OPF are just filenames. But if the OPF is in the root directory and all text files are in OEBPS/Text, the "hrefs" must contain OEPBS/Text/...

06-26-2012, 09:28 AM
Thank you all for your answers.