The wonderful odyssey of publishing to Apple Books (possible issue with hyperlinks creation)

Engaged ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Dear all,

I have a possibly interesting issue to show. 

I use InDesign to create my sheet music editions that I then publish here. I create the musical score in Avid Sibelius, export it to PDF, then write the text in Word, format it, then build everything in InDesign (17.x for today's example). Once ready, I export it to PDF for those services that need a PDF and to EPUB for—sigh—Apple Books. 

Leaving out the fact that most of the time any EPUB that I export is always containing images of more than 4 million pixels (which I normally solve by lowering resolution to 150ppi), the issue today was this one: 

Screenshot 2022-02-02 at 11.48.01.png

Not understanding what this meant I asked Apple for help, they replied:     

You encountered this upload error because one of the links in your book is missing text, refers to a reference that doesn’t exist, or is not formatted correctly.
To resolve, the value of attribute “src” must be a URL.
Not knowing what the "src" attribute was I dived into the INDD and found the only four pieces of text that contained URLs. After a lot of testing I found out that my accidental mistake was to select the region of text that was to become a hyperlink and choose the option "New Hyperlink from URL" (which looked the more logical to me). This created a link that looked like this: "http://<selectedText>" where selectedText would be the region of text. Even hitting Cmd-Z to undo, selecting again, choosing "New Hyperlink" and pasting in the correct URL, left me with this: 
Screenshot 2022-02-02 at 21.15.42.png
The sheer fact that this URL was in this list made the EPUB validation check of authors.apple.com go crazy with error messages, while it made outright crash the iTunes Producer app on my Mac! 
Removing all links from the document, exporting to EPUB, and validating succeeded, but I need those links and if I try to create them again, that list appears as it was before. 
I wonder if any of you has any experience with publishing on Apple Books and would be so kind to share some of his knowledge. In any case, my questions are:
  1. How can I remove that faulty hyperlink short of recreating the INDD from scratch?
  2. What is the best way to create a hyperlink to a web URL starting from a selected region of text? 

Bottom line: for the curious, the only way I could publish this to Apple Books was the following ridiculous procedure:

  1. Export PDF from InDesign
  2. Open PDF in Acrobat and export each page as separate PDF
  3. Open Pages and create new Blank document
  4. Import each page, one by one, and resize it to fit the page, into the Pages document
  5. Forsake the idea of having bookmarks and ToC in such a Pages document without altering your original design
  6. Upload to Apple Books and enjoy! 

 

TOPICS
Bug , EPUB , How to , Publish online

Views

880

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Feb 03, 2022 Feb 03, 2022

You are aware that unused hyperlinks may be deleted by opening the Hyperlinks panel, and selecting the Delete Unused Destinations menu entry in the panel menu? That should fix that problem. InDesign keeps the previously created URLs just in case those are referenced by other links later. So you need to clear these unused destinations.

rayekelfin_0-1643876104459.png

Secondly, regarding your image resolution issues. I checked your books previews, and the resolution of those score page images is far too high: 4959 by 7017 px! Equ

...

Likes

Translate

Translate
Community Expert ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Honest answer? I avoid publishing to Apple Books and advise my clients similarly.

 

But I'm sure that's an unpopular position, surrounded here by Mac users. 🙂

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

I like Apple Books as a user, but as a vendor it is such an unbelievable pain. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

You are aware that unused hyperlinks may be deleted by opening the Hyperlinks panel, and selecting the Delete Unused Destinations menu entry in the panel menu? That should fix that problem. InDesign keeps the previously created URLs just in case those are referenced by other links later. So you need to clear these unused destinations.

rayekelfin_0-1643876104459.png

Secondly, regarding your image resolution issues. I checked your books previews, and the resolution of those score page images is far too high: 4959 by 7017 px! Equivalent to an A4 sized sheet at 600ppi. WAY too much for digital devices. And the file format used (jpg) is also excacerbating matters: jpg is unsuitable for this type of black and white images. It unnecessarily adds to much heavier book file sizes. And may actually cause performance issues for ereaders.

 

The most effective approach is to check the what the max resolution is that you require for a given device. Let's say you'd like to support up to a max resolution of the ipad Pro 12.9": 2732 by 2048 px. 

 

Export your sheet music images as PNG file format. Then use an image editor to scale down the images to a max 2732 px height. I scaled one of your sheets down to 1931x2732. I then used Color Quantizer to optimize to 16 grey scale values (more is not required - still looks sharp). Alternatively use Photoshop to generate an optimized PNG image, but Photoshop isn't that great for this particular job. http://x128.ho.ua/color-quantizer.html

 

Result: a 108kb version, optimized for resolution and file size. Compare to your unoptimized version that clocks in at 1.59mb!

 

Alternatively, Sibelius exports directly to PNG, btw. Change the PPI export setting to one that results in the required resolution. Do not use monochrome, but anti-aliased when you do this.

 

(An even better approach is to rely on SVG images in this case. See bottom for more info)

 

Next, do not rely on InDesign for image conversions. I created a new InDesign document using the iPad Pro 12.9 inch document template. I dragged in the image, and it fit the page snugly.

To prevent InDesign from messing up your optimized image and reprocessing it, perform the next step:

 

rayekelfin_1-1643877355411.png

Select the image, and open the Object Export Options. Change the Preserve Appearance From Layout to Use Existing Image for Graphic Objects.

This tells InDesign to use your optimized asset when the epub is generated, rather than reprocess it and turning it into a trainwreck of a file.

 

Congrats, your book size just got reduced by a factor of 10 to 14, and performance is optimized greatly as well. It will work nicely on all iPad versions now.

And PNG retains the quality of such graphics like these far better than jpeg (jpeg is lossy and suitable for photos. PNG is lossless which means sharp-edged artwork and music notation is kept crisp looking).

 

 

Far smaller book sizes, much improved viewing performance experience, and a sharp looking result! What's not to like?

 

But we can do better. 🙂

epubs and InDesign also support SVG (Scalable Vector Graphic). This would be preferable over a PNG, because a SVG is a vector image, and even when the user zooms in, the notation remains absolutely crisp looking.

In my example I converted a PDF page exported from Sibelius to SVG using PhotoLine (Illustrator will also work for this step), which results in a ~533kb SVG. Still THREE TIMES smaller than your original jpg version, and with the added benefit of a supreme quality, even when the reader zooms in.

Make sure to tell InDesign to use YOUR SVG file via the same step as described above.

 

Please check out the attached epub. The first page is the PNG version. The second page contains the SVG version. Compare by zooming in. Even zoomed out the SVG renders much nicer. And still a factor 3 smaller book file size compared to your original.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

Wow! First of all, please forgive my delay, I didn't get the notification for this message! 

Awesome set of advices! 

First thing, hyperlinks, thanks! I will now remove all those which are unused following your suggestions. 

Now for the rest, let's break it down:

  1. I normally export all my scores as PDFs from Sibelius because a) every provider, customer, publisher apart from Apple asks for it and, most importantly b) it exports as a single file. Exporting to PNG or SVG is possible but only if I export it page by page. You may say that in any case I have to place each image one by one in InDesign, but I wonder if there would be a script for it. 
  2. From what I see during the EPUB exporting process in InDesign, the Automatic process is to convert everything to PNG (sometimes I saw TIFF, but am not sure). It creates JPG/JPEG only if expressively selected. 
  3. What do you suggest to patch scale down a folder of PNG/SVGs? I'm on macOS 12.x — same question for optimising the color: is there an app, possibly in Adobe CC, to do this? Better if not Photoshop 🙂 
  4. For exporting PNGs I can set the dpi in Sibelius, but what is the mathematical formula to obtain that? Is it done by dividing one side of the resolution by the size of the printed page in inches? In my case I'm using 9x12in paper. I know there are tools online but I'd like to learn how to do this myself. If I export SVGs from Sibelius it defaults to 147.78dpi and it is not editable. Since Sibelius is not so good at handling SVG/PNG I would prefer, if possible, to export to PDF and then maybe use Illustrator to export to SVG/PNG. Do you think this would be a viable option? 
  5. I like very much your idea of using an iPad Pro template for this, but since it has to be good for print as well, I normally build the INDD and then work my way up from there. 
  6. For the Object Export Options: do I have to do this manually for each image in the book? It could grow up to a lot of time for this. Any automation possible? 

 

Thank you for all your help and advice! I really appreciate it!

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

Not to grumble, but I see that as another strike against Apple books. The ONLY format suitable for screen viewing and printing is a vector-based one like PDF. Forcing you to compromise with raster image resolution trying to accommodate both purposes is... outdated and limiting.

 

(I have a child in conservatory, and he gives me all the feedback I can stand about sheet music publishing these days...)

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

As an independent publisher trying to dig his own niche, I would love to hear your son's feedback and hear where he would like sheet music publishing to go. I have no constraints like other big publishers do, and the community I'm trying to grow around my publications is the only reliable source I can follow.

Feel free to contact me about this—if you feel like, of course—here with a PM for example.

Thank you 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

It's pretty simple: he prefers PDF that is created with live type and layout, which I believe Sibelius can do. (As the only non-musician in the household, I only paid some basic tech-support attention to the composition and sheet music tools he and his mother, a pianist, used over the years.) I know he hates PDFs that are raster or scanned, especially when it's old material and the scan quality is poor. I was called on to do some image cleanup magic for a few complex pieces where the notes were blurred together.

 

PDF, unfortunately, has amost zero DRM security, though. It's a pain to have to choose between the technical wonder that is PDF and the maddening kluge that is EPUB just because the latter supports stronger DRM.

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

Could you define "live type and layout"? 

Maybe I know what it is, just I've never heard it called that way.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2022 Feb 12, 2022

Copy link to clipboard

Copied

The active type and graphics of a format like PDF (or reflowable EPUB), which are vector and thus scale infinitely as well as being selectable (if permitted). Instead of raster-based images that are just images on a background.

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 20, 2022 Feb 20, 2022

Copy link to clipboard

Copied

@rayek.elfin 

I see an issue with exporting SVGs from Sibelius directly ... they are MASSIVE!

The full score I'm working on, 25 pages, when exported from Sibelius as a PDF is 553kB in total size.

The SVGs are, all pages together, 13.3 MB! 

What could have gone wrong here? Could there be an issue with how Sibelius exports SVGs?

Should one just convert a PDF into SVG? 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2022 Feb 20, 2022

Copy link to clipboard

Copied

The short answer lies in that PDF is a vector format highly optimized to manage text (as fonts) and graphics. SVG is a hybrid, mostly vector format that only works in vectors and outlines and can assume nothing about its contents, so it must use a more comprehenisve encoding format.

 

Think of it this way: PDF can encode "put a quarter note right here, using the Maestro font at 12pt." There only has to be one code instance of a quarter note in the whole file, called on as necessary.

 

SVG has to convert all of that to individual vector instructions to create and shape a quarter note symbol, a coding multiple of... 20? 50? Multiply by 10,000 elements in a score page and... you get massive. (Don't SVGs also include raster preview images as well? Not completely sure.)

 

PDF is almost always going to be vastly smaller and more efficient. But not many publication standards that allow DRM use it.

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

Ah yes, InDesign's glorious epub export at work again. 🙂

 

The answer provided by @James Gifford—NitroPress is only part of it, I am afraid. Correct, SVG may not be as optimized as a PDF. But there is more to it.

 

Simply stated: InDesign's epub export is shoddy in this case.

 

Long answer: InDesign produces very large epub files under certain circumstances. This happens to be one of those outlier cases. Alow me to explain.

 

I place two Sibelius converted SVG files in InDesign and export the two page document to epub. The result is a 1.10 MB sized file. This seems to be understandable, seeing each SVG is 554kb in size.

 

Let's open the epub in Sigil and resave as a new version. Sigil complains that the InDesign file is a faulty non-compliant epub, and proposes to fix those errors for use. How nice. Otherwise no changes made! After resaving the file the resulting file size is...

...138 kb???!!!!

What is happening here?! Why is the file almost 9 times smaller in file size, even though no changes were made to it?

 

It's really quite simple: Sigil actually compresses the epub file, while InDesign exports an uncompressed epub file.

Understand this: an epub file is merely a slightly different type of ZIP archive. InDesign does not use any compression when saving an epub file, while Sigil does.

Try it yourself: an SVG is a text file, and uncompressed text files are file size gobblers. Zip that 554kb text file, and it compresses down to a small 62kb file.

 

(Btw, if we would zip that file with the "store" parameter, it would result in a slightly larger file! That's exactly what InDesign is doing here!)

 

And there it is: the solution. Do not rely on InDesign's epub export to produce a small file in this particular case.

So do you then have to open each epub file in Sigil and resave? While that is inded an option, a better approach is to use eCanCrusher instead.

https://www.docdataflow.com/ecancrusher/

 

This is a simple tool that allows us to drag and drop epub files on top of its icon. Drag an epub on it, and it produces an unzipped folder of files. Drag and drop that folder again on the icon, and it generates a compressed epub file.

 

Case closed.

 

Well, almost.

 

To optimize the epub file size even further, consider optimizing the SVG files with InkScape (again a free tool!). Open the file in InkScape, then choose File-->Save As. In the Save as Type options select Optimized SVG and export a new optimized version. After a bit of tinkering I reduced the original 554kb file to 457kb - a sizable reduction. This resulted in an InDesign exported version of 934kb (before: 1.1MB!).

 

Then use eCanCrusher to create a new version at a final file size of 103kb!

A file size reduction of over 10!!! times!

 

Your 13.3MB epub should be reduced to around 2MB after a simple eCanCrusher recompression. If you optimize the SVG files with InkScape it should be around 1.2-1.4 MB.

 

So unfortunately InDesign's epub export is rather useless in this particular case - at least if you require the file to be exported at manageable file sizes.

 

As for your remaining questions:

rayekelfin_0-1645666900702.pngI normally export all my scores as PDFs from Sibelius because a) every provider, customer, publisher apart from Apple asks for it and, most importantly b) it exports as a single file. Exporting to PNG or SVG is possible but only if I export it page by page. You may say that in any case I have to place each image one by one in InDesign, but I wonder if there would be a script for it.

 

https://creativepro.com/import-folder-full-pictures-page/

I am unsure if this works with SVG files, but I see no reason why not. Haven't tested it myself.

 

rayekelfin_1-1645666900703.pngWhat do you suggest to patch scale down a folder of PNG/SVGs? I'm on macOS 12.x — same question for optimising the color: is there an app, possibly in Adobe CC, to do this? Better if not Photoshop ‌‌:-)


On Windows I use IrfanView to batch process hundreds of images in a few seconds (Photoshop's batch function is incredibly slow to process images, so I avoid it as well).

On Mac you can do it as easily with Preview:

https://www.alphr.com/how-to-batch-resize-images-mac/

 

rayekelfin_2-1645666900704.pngFor exporting PNGs I can set the dpi in Sibelius, but what is the mathematical formula to obtain that? Is it done by dividing one side of the resolution by the size of the printed page in inches? In my case I'm using 9x12in paper. I know there are tools online but I'd like to learn how to do this myself.
If I export SVGs from Sibelius it defaults to 147.78dpi and it is not editable. Since Sibelius is not so good at handling SVG/PNG I would prefer, if possible, to export to PDF and then maybe use Illustrator to export to SVG/PNG. Do you think this would be a viable option?
By @Inélsòre

 

PPI/DPI is entirely unimportant for vector files such as SVG. They will print, just like vector PDFs, at the highest resolution the output device is capable of, and display at the highest resolution a screen is capable of irregardless of zoom factor.

I see no real reason to use an inbetween step and export the PDF as SVGs, but for the fact that Sibelius is unable to save all pages as singular files. So in the end it depends on your own workflow.

 

To figure out the exact PNG resolution for a black-and-white 1200ppi file, calculate:

(width in inches) x 1200 and (height in inches) x 1200

Or set to 9x12" paper size, and input 1200 ppi(dpi).

 

Although reducing the resolution to 800ppi probably is sufficient to garantuee good regular print quality (not for professionally printed notation!).

 

rayekelfin_3-1645666900704.pngFor the Object Export Options: do I have to do this manually for each image in the book? It could grow up to a lot of time for this. Any automation possible? @Inélsòre

 

I just create an object style with those settings (far bottom left of the object settings you will find these attributes) and select all images and apply that object style.

 

PS apologies for the late response. I only noticed your @Inélsòre response today!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

Thank you @rayek.elfin,

I have downloaded the tools you suggest and will see what they can make with my EPUBs.

So far I'm still plagued by the issue described in this post, which I cannot find a solution for. 

I will also try Inkscape because Sibelius' SVGs, opened in Illustrator and re-saved, actually become bigger in my early tests. 

I'm using EPUBs only for Apple Books publishing and they do not accept images bigger than 4mi pixels, which a 1200dpi PNG greatly surpasses. From what I understand InDesign creates EPUBs by exporting each page as a PNG at the desired resolution (default 150dpi). Anything >300dpi is good for reading music but, as you say, it is not for commercial printing. 

Thank you also for the scripts and tutorials about batch converting images. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

@InélsòreJust use SVGs instead of PNG files, and the resolution issue is bypassed.

Also, don't forget to either open and save in Sigil or use eCanCrusher to open/save to compress the epub, and the epub file size issue is solved as well.

 

InkScape features a special Optimized SVG export/save option, which reduces the size of SVGs quite a bit, a explained in my earlier post.

 

Don't rely on InDesign's automated PPI setting. Prepare the images yourself. And avoid InDesign for autmatic image processing, because the quality is not that great. But hey, that is my opinion.

 

I gave you a couple of answers to resolve the problem in your other post.

 

In your case, I'd suggest the following workflow:

 

  1. export the notation sheets from Sibelius as SVG.
  2. Open these in InkScape, save as optimized SVG.
  3. Import in InDesign. Use the Object Export options as explained in an earlier post (use Existing Image for Graphic Options). You might want to create an object style that includes these things and assign it quickly to all sheets in your document.
  4. Ensure all SVGs are imported in an object tag (found in the Object Export Options).
  5. Create TOC with links as explained in my answer in the other post.
  6. Export your epub.
  7. Open in Sigil, allow Sigil to fix the epub issues. Resave in Sigil, and a compressed version is saved. File size is reduced by 90%, or so, compared to the InDesign version.

 

Done! Relatively low file size, and vector-based notation sheets that render very nice on the screen, and print even nicer. No issues with bitmap resolution, etc.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

Thank you! I will save both this and the other post as reference for any future issue as you have opened my mind to new worlds of solutions! 

SVG export from Sibelius is so bad because it exports cut-down images (i.e., without margins!), but I will keep this in mind. I am not sure I understood point 4) as I only found the Tagged PDF tab with a submenu talking about Object options, maybe it's that one.

In my current experience opening in Sigil reduces size TO 90%, not BY, but I'm sure I need to optimise things on my end before. 

Thank you once more!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

Ah yes, that is why I converted the PDF files, which do include the page formatting.

 

The object tag option is found in the object export options - either embedded svg in the html, or a separate svg file linked to via the object tag.

PS which version of InDesign do you use? The latest?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

Yes, 17.1, I have your same window on screen. 

Yet I do not see the object tag option you talk about, is it in the EPUB and HTLM tab?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

Published file sizes are almost always directly proportional to contained image quality. If you need large, high-resolution images, it's going to be a large file.

 

The freeware editors and compressors and so forth for EPUB are — IMVHO — not very effective tools nor recommended for professional results. Most of the "FreEPUB" world is amateurs and author/publishers who have only a slight grasp of the technical issues involved. They use Word and Publisher and Calibre and so forth to build their doc, then have problems that the editor tools can sometimes fix, and see the size-reduction feature as some kind of magic.

 

But the only way Sigil or Calibre or any of these tools can reduce an EPUB significantly is by compressing the image files. Which, in a professional approach, should be scaled and optimized at the document creation level, not in a post-processing step.

 

And in your case, you are caught firmly between the need for acceptably high resolution for your final docs, which inherenty/inescapably means a large file size (from inherently large images)... and compressing the files after creation is going to reduce that resolution to an unacceptable level.

 

I don't see any third alternative if you must use image-based pages. Only a vector format can contain complex page information at a reasonable file size (but, with perfect resolution).

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

I am using PDFs or SVGs for all my images but I now have a doubt: when you export an EPUB from InDesign you see a progress bar saying "writing PNG". Does it mean that the "Automatic" version of EPUB exporting in InDesign is actually rasterising the vector files at 150ppi? 

If so, then the images will forcefully become pixelated and lose quality, even if I choose 300ppi (though there it will be less noticeable). 

For me, size of the final document is not an issue, it can also be a 300MB EPUB but there is an issue with Apple saying that when an image is more than 4mi pixels it cannot be uploaded. This seems to confirm that an EPUB is rasterising the vector images, and obliges me to use smaller resolutions when uploading to Apple Books, which will inevitably result in a lower quality. 

I am sure some pro has found a way to make this work, but I am certainly not there yet! 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

I haven't read every entry here, but have you tried the relatively straightforward process of:

  1. Export score pages to PDF
  2. Convert PDF to SVG, using any of the many online conversion services
  3. Place SVG as object in INDD file
  4. Export to EPUB with Object | Preserve Appearance unchecked and Use SVG as: Embed Code

 

I just did  a couple of quick tests with this and while there were issues (the embedded SVG shows up small in scale, which is fixable), it seemed to work very well. You may have to revise your work/flow at each step to get the result you need, but in all cases the file size remained small (PDF: 51k; SVG: 45k;  EPUB: 22k). No rasterization; the SVG is an XML file.

 

Other than tweaking, everything from that EPUB would be whatever Apple Books chooses to do with it... which may not be under author control.

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

rayekelfin_0-1646017410707.pngBut the only way Sigil or Calibre or any of these tools can reduce an EPUB significantly is by compressing the image files.

 

In this case (see below) InDesign will not compress SVG files when these are placed in an object tag.

 

Also, the epub file itself can be compressed better with Sigil or eCanCrusher, irregardless of image compression. By opening and saving an InDesign epub in Sigil or recompressing with eCanCrusher, the resulting epub file is smaller.

 

rayekelfin_1-1646017410706.png[..] compressing the image files [..] in a professional approach, should be scaled and optimized at the document creation level, not in a post-processing step.

 

I agree. And a professional should (in my opinion) not rely on InDesign to take care of this step by relying on the automated InDesign settings, and rather perform this step in external software (image editor, vector software, dedicated bitmap optimization tools, etc.).

 

rayekelfin_2-1646017410707.pngThe freeware editors and compressors and so forth for EPUB are — IMVHO — not very effective tools nor recommended for professional results. Most of the "FreEPUB" world is amateurs and author/publishers who have only a slight grasp of the technical issues involved. They use Word and Publisher and Calibre and so forth to build their doc, then have problems that the editor tools can sometimes fix, and see the size-reduction feature as some kind of magic.

 

Oh, definitely. But that doesn't mean the free and open source Sigil epub editor isn't suitable nor recommended for professionals. If anything, my experience with InDesign's epub export throughout years and years of using it is that there are many pitfalls to evade and jump over, and it actually requires external tools to fix the output in most cases - both for the code, as well images.

 

I would argue against using InDesign as a tool to rely on for the final epub export. It just isn't good enough in most cases (in my opinion). Just as I would with Word/Calibre produced epub files 😉

 

rayekelfin_3-1646017410707.pngI haven't read every entry here, but have you tried the relatively straightforward process of:
  1. Export score pages to PDF
  2. Convert PDF to SVG, using any of the many online conversion services
  3. Place SVG as object in INDD file
  4. Export to EPUB with Object | Preserve Appearance unchecked and Use SVG as: Embed Code

 

[2] requires the upload to online conversion services, which I would never suggest or advice if the content is copyrighted. Instead, download InkScape and perform the conversion, with the added benefit of being able to optimize the SVG.

 

[4] is interesting. I tested it: your method (embedding the SVG in the xhtml pages themselves), and my suggested workflow by setting the object export options to Use Existing Image for Graphic Objects and Use SVG As: Object tags. (I assume you @James Gifford—NitroPress are also using the existing images, and not the default, otherwise all SVGs would be converted to images).

 

The initial resulting epubs exported from InDesign seems to work in favour of your method:

641kb (nitro) versus 2139kb (mine).

 

But after either using Sigil or eCanCrusher to re-compress, both end up (as expected) at more or less the same file size: 343kb.

It seems InDesign doesn't compress the SVG files when those are included as separate files (which I prefer, because it really isn't convenient to have all that SVG code embedded in your xhtml pages while working with the code if required).

 

In either case it is a no-brainer to recompress/resave either in eCanCrusher or in Sigil.

(As it turns out, Sigil fixes some issues with the code, and saves a lighter version compared at 329kb!)

By replacing the offending PNG images with smaller replacements, the final epub file size clocks in at

 

@Inélsòreat this stage we have to be careful of InDesign's prone behaviour to include huge dimensionated transparent PNG files in fixed epub files. In my test (once again) InDesign includes three PNG files for each page. These will compress really well because - well - these lack any content, but Apple will choke on these warnings about your epub including too large image files.

 

I always reduce these to 16px images. It will not have any impact on the epub layout or display.

 

Anyway, in this particular case it is best to avoid relying on InDesign's exported epub files.

I did learn something new: it is interesting to discover that InDesign does not compress SVG files when tagged as with an object tag instead of embedding the code in the pages.

 

PS I used a three page epub with three Sibelius pdf-->svg converted music notation sheets in this experiment.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 28, 2022 Feb 28, 2022

Copy link to clipboard

Copied

Thanks @rayek.elfin, and @James Gifford—NitroPress, all this is incredibly interesting!

Let me summarise to check if I have understood it correctly: 

  1. leaving Object Export Options | Preserve Appearance From Layout to Default makes EPUB export use the options in Export EPUB | Conversion Settings (which should default to PNG)
  2. setting it to Use Existing Image for Graphic Objects prevents them to be converted to PNG
  3. now, one could set it to Embed Code or to Object Tags. Could you explain me the difference between these two options and, especially, what "Object Tags" are per se? 
  4. If I go to my INDD where all music pages are still PDFs, entering Object Export Options brings me to the Tagged PDF tab. What are my options there? Can I preserve the PDF as is or I can do that exclusively with SVGs? 

Both of you mentioned "professional" software for creating EPUBs instead of using InDesign. What would those softwares be? 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 28, 2022 Feb 28, 2022

Copy link to clipboard

Copied

I tried your steps but it seems there is an issue with SVG not embedding fonts.

I use an Adobe Font in Sibelius for the text styles; it is activated as also InDesign Text Frames read it properly; the converted SVG throws an error in Preflight saying that such font is missing. 

The remaining question for me is: what gets written on the EPUB page when exported from INDesign? A PDF/SVG or a PNG/JPEG version of it? When Apple complains it talks about pixels, but vector artwork should not depend on that, right? 

For my workflow, converting hundreds of PDF pages in SVGs would be quite unwieldy so if I can keep the PDF I would prefer it.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2022 Feb 28, 2022

Copy link to clipboard

Copied

I was afraid of that (the fonts issue). I don't have an easy way to test these docs on a system without the fonts locally available (I could uninstall fonts, etc. if I was focused on working things through, yes). So I didn't catch that.

 

I don't know specifically what's being written to EPUB from ID, but if you are using Reflowable v3.0, it should NOT be rasterizing the pages, even using the unusual notation fonts. That conversion to page images seems to be happening on the upload/conversion to iBooks format. You should be able to open the EPUB (using any ZIP archive tool) and see if there are very large images in the \images folder. If not, ID's not doing it.

 

Your publication is simply pushing the limits of current ebook publishing, with its need to use a very specific (notation) font and remain optimized for both screen display and printing with adequate resolution. If the only thing iBooks supports is page image files that are huge, but not *too* large, you're going to have to optimize the construction around individually generated image files that are at that precise limit, and accept that it's going to be a huge file and less than optimal when printed.

 

As I noted, I have musicians in the family, and have years of familiarity with their struggles to find acceptable e-book or downloadable sheet music. And as the tech guy (who can't play a kazoo!) I often got tasked with trying to turn crummy scanned pages into something usable on a music stand.

 

I suggest you look at other publications on iBook and see what solutions and compromises they've made, and once you know the limits, perhaps we can help steer you to the same results.

 

Tacking onto my longer rant, what we really, really, really need is a version of PDF that accepts high-security DRM. That would solve so many of these problems!

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines