Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Pages file doubles on export to .epub

When I export a Pages document to .epub, the file size doubles. I have a lot of .png images, and I have compressed them, but it still goes from a 12MB Pages file to a 24MB .epub file. What is happening and how do I keep my file to under 20 MB?

Posted on Oct 24, 2010 8:56 PM

Reply
15 replies

Oct 26, 2010 7:33 PM in response to Tom Harrison

How do you open the epub file? What application do you use?

There are many applications which will do this. I usually use the free StuffIt Expander App. (I.e., I just drop the ePUB file on the the Expander icon and it opens a copy of the ePUB as a folder at the original file's location.)

I have to put it into iTunes and synch my iPad in order to see the resulting iBook.

You can open any/all of the XHTML files in the opened ePUB folder using Safari (or other web browser) instead of going through iTunes to iBooks equipped mobile device. This is usually much faster for me but may require reloading the page to get the correct display. You can also open the exported ePUB in reader apps like Adobe Digital Editions or Sony Reader Library. Unfortunately, Safari and the other digital readers usually show the ePUB content as it was supposed to be exported while the iBooks reader does not always render the ePUB as it was originally created in Pages (E.g., I can usually get centered titles or full justified text but not always both at the same time.)

And what is a package? There is nothing in the Pages User Guide that mentions the word package.

I use the "Package" preference option in Pages to create self-contained project files which can be opened using the contextual menu. These "packages" contain the media (images, shapes, movies, etc.) which can be compared to the ePUB exported media files as to file sizes and resolutions to see if/how they've changed during the export process. (See the "Preferences > Saving" menu options in the "Preferences" window.)

User uploaded file

Oct 27, 2010 10:20 AM in response to Tom Harrison

Thanks Jon. I saved the file as Packages using the Preferences, and I looked at the file structure using Stuffit. But I am concerned about what I found. I had deleted all my images and replaced them with compressed versions and new file names. That part is good, but Stuffit showed that both the old image files and the new image files have been saved in the images sub-folder inside the OPS folder. How do I find the old files and make sure they are deleted?

Oct 27, 2010 11:09 AM in response to Tom Harrison

How do I find the old files and make sure they are deleted?

Interesting, but not something I've encountered previously. I would probably try three things:
1) Locate old images.Have you, for instance, "stacked" or "layered" images in an object somehow? (Not sure this is possible but it might explain their being able to "hide" from view."
2) Replace all images with a single, copied image and re-export the file to see if the images folder is cleared except for the used image.
3) Try re-saving the the project under a different name and then re-exporting an ePUB under the new name to see if this clears up the old/new image duplication problem.

Not sure if any of these things will help, but basically all I'm recommending here is to vary the conditions and see if/how these changes affect the output.

User uploaded file

Oct 27, 2010 12:41 PM in response to Tom Harrison

My mistake. On closer inspection I see that there are not duplicates, but that some images have the old file names and some have the new file names. I am replacing old with new now. However, Stuffit tells me that the individual images are a different size than what I see when I look at each image's File Info. For instance, Stuffit tells me that one file is 410KB but my File Info says that file is 98KB. I much prefer the smaller file but I don't know what happened here. Any ideas on how to get my images down to the size to which they were compressed? Or does Stuffit (and Pages) somehow know what the original file size was and are using that to calculate the size of the images?

Oct 27, 2010 3:39 PM in response to Tom Harrison

Any ideas on how to get my images down to the size to which they were compressed? Or does Stuffit (and Pages) somehow know what the original file size was and are using that to calculate the size of the images?

Sounds like you are being caught up too much in a numbers game here. The only true measure is the final amount of space taken up by the ePUB package which is, essentially, just a zipped package of files that are basically text and images.

Applications and utilities tend to differ in how they report a file's size. For instance, my cover JPEG files are 1.39 MBs (the decompressed file size) according to one application, 472 KBs of disk space (data + header + container with or without empty space allocation) according to the OS Finder, but only contains about 351 KBs (compressed data) according to yet another application--all readings for the same file as stored in the Pages package. When converted to a PNG at 2/3 the original dimensions (or 4/9 the surface area) file and embedded in the ePUB export, the same applications/utilities now report file sizes of 606 KBs, 496 KBs, and 493 KBs respectively. However, now we are comparing apples and oranges since we have added the complication of changing the compression format from JPEG (which most applications allow you to easily vary the amount of compression drastically) to PNG (which none of my normal applications allow me the vary the compression).

My basic recommendation is to use high quality/low compression images in the project and simply let things fall as they may during the export process. Of course, since I sometimes include movies in my ePUBs, my exports sometimes tend to be somewhat large. If you cannot bare to live with the file sizes as converted/exported by Pages, and, if you have the capability to actually create PNG files with a variable compression ratio, then, by all mens, simply replace the Pages generated files in the expanded ePUB folder with your own files having the exact same names and extensions, re-ZIP the folder, and change the file extension back to ".epub" to use your manually modified media/content.

User uploaded file

Oct 27, 2010 4:23 PM in response to Jon Walker

Jon

There is no such thing as .png files with variable compression.

As I said above .png is not a lossy format and has a set internal compression algorithm which does not make the smallest files.

It is important to make sure you have used the right format for the image. That could be variously, .gif, .png, .tiff compressed & uncompressed, jpeg and .pdf.

2 excellent formats DjVu and .svg are unfortunately poorly/not supported in OSX and Pages.

Peter

Oct 27, 2010 7:28 PM in response to PeterBreis0807

There is no such thing as .png files with variable compression... As I said above .png is not a lossy format and has a set internal compression algorithm which does not make the smallest files.

Actually, it employs a 2-stage compression process that can be affected by numerous settings such as the number of channels used, channel depth, interlacing, pre-compression filtering, etc. However, settings that can be accessed by the average user are normally very limited in most common graphic applications. Since I have no idea what applications are available to the OP here, I cannot completely rule out the possibility that various settings are being manipulated to vary the pre-compression before DEFLATE is applied and that is OP may just possibly be importing PNG files to the project. (I.e., not very likely but not totally impossible either.)

As to what is really happening here, I suspect the OP is importing moderately to highly compressed JPEGs and is at a loss to understand why the PNG output files have increased in size. As I indicated previously, it is probably just a case of apples (in the input) being compared to oranges (in the output).

In any case, the question is interesting and if/when I can find the time, I plan to run some tests see what effect changing the input color mode of various file formats will have on the output PNG file. (I.e., will the output still be an indexed color palette at 8-bits/channel or will Pages make adjustments to match the source file settings since most of my images are grayscale and/or B&W?)

User uploaded file

Nov 1, 2010 2:04 PM in response to Tom Harrison

All my images (55 of them) are .pngs. I tried several variations - changing them to .jpgs, .gifs, etc. File size reduction was negligible but the image quality with .gifs was really poor. These images are all portions of topographic maps which are going into a guidebook. I designed the maps myself in Freehand and took a screen shot of each for the .pngs. The reason I want the final .epub file to be under 20MB is because that is the upper limit that Barnes & Noble will accept for their ebook store.

An interesting variation comes when you change from an 8.5" x 11" page size in Pages to something much smaller or something much larger. A small Page Setup (say 4.5 x 5.5) brings the .epub file down to about 8MB. Looking at that on the iPad (after importing it through iTunes) finds that the iPad scales the text perfectly but shrinks the images drastically. With a large Page Setup (say 12 x 16) the iPad again displays the text perfectly, and the images are pretty much full iPad page size. But the .epub file size goes to about 48MB. All this is using the same images in all iterations. And with the large Page Setup the images may or may not display on their own page, even though there is a Page Break before and after the image.

And that is pretty much all I know about formatting a Pages file for .epub. If there are any ideas on how to get my images to display on only one page with the larger Page Setup I would appreciate it. I know the reader can double-tap to enlarge but we want to make it easy for them.

Nov 1, 2010 4:08 PM in response to Tom Harrison

Peter - I would love to keep the files as pdfs but the .epub format does not accept pdfs. This guidebook is a commercial venture. My business is publishing maps and I have teamed up with a guidebook author to incorporate text and maps into an iBook format. That means the images have to be png, gif, jpg, or tif. No pdf is allowed in .epub. Sigh...

And for what it is worth, the best Page Setup I have found (so far) is the good old 8.5 x 11 letter size. you just have to adjust your page margins in a way that works well with your images.

Pages file doubles on export to .epub

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.