TOC Text Anchor not found

Engaged ,
Feb 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

Could someone help me with this error? 

Screenshot 2022-02-22 at 12.42.30.png

I have already updated the ToC not to use Text Anchors ... 

I have removed and recreated the ToC ... same error ... 

I have tried with checking the "make text anchor in paragraph" option but it then gives the same error, and every time I need to rebuild my custom bookmarks ... 

What can I do? How can I find what are the "offending" text anchors that are not found? 

I tried to make a copy of the INDD, remove the TOC and export, which gave no error. Recreating the TOC and exporting to EPUB gave the same error ... 

TOPICS
EPUB , How to

Views

333

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 26, 2022 Feb 26, 2022
This is a known problem: text anchors in hidden layers fail when exported. Or rather, when you hide things, those are not exported in an epub. In simple words: by hiding those text anchors, obviously during export InDesign throws an error that the TOC entries (which are links) cannot find those destinations. And export fails, of course. It's not a bug, but I suppose you could call it a glitch? Or "intended behaviour" as a developer would call it. In any case, three workarounds: Hide by layer or...

Likes

Translate

Translate
Adobe Community Professional ,
Feb 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

Remove all toc-related text anchors manually.

Recreate the toc with new text anchors setting.

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 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

How do I do that? 

What are those anchors?

Are they the hidden text frames I have created? If so, deleting them doesn't solve it. 

I then deleted the TOC, recreated the hidden text frames (in another layer as usual, then hid the layer), recreated the new TOC and hit export. This time this was the result: 

Screenshot 2022-02-22 at 13.29.09.png

 Now, if I go and check the checkbox it asks me to do, it suddenly finds no text anchors ... 

 

There is clearly something going on here, as the EPUB Interactivity Preview also shows the table of contents as not working. Interesting fact: exporting to PDF works beautifully. Here is how my TOC is organised, hopefully someone will find a way to help:

  1. There are 5 desired entries in the TOC so I created 5 text frames with a dedicated paragraph style on the pages I wanted to show. 
  2. I put these 5 text frames on a separate layer and hid the layer.
  3. Created a TOC including objects on hidden layers but not checking the "make text anchor" option

Got the error above. Recreating the TOC with that option checked gives me the "TOC Anchor not found" error... 

 

Update: if the text frames are not hidden the EPUB exports and validates without any issue.

How is that possible? And how do I make it the way I need it to 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
Adobe Community Professional ,
Feb 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

Hi Inélsòre,

my guess is:

You at least once used the option [x] Make text anchor in source paragraph with your TOC.

Then you edited the text and five of the special characters that are the anchors were removed during the editing process.

The next time you did not use "Make text anchor in source paragraph" when updating the TOC, the remaining anchors from updating the TOC before are still there. Your EPUB export is detecting them and also detects that some are missing.

 

Text anchor special characters can be found with TEXT Find/Replace.

Search with pattern <FEFF>.

But do not remove all found automatically in one go.

There could be FEFF special characters that have other purposes.

 

You will find the remaining TOC related special characters at the beginning of the paragraphs that are collected with the TOC.

 

Regards,
Uwe Laubender

( ACP )

 

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 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

The research found no match. 

The fact that un-hiding those frames made the EPUB export seamlessly gave me an epiphany: in previous publications I usually created an INDD, inserted the multipage-PDF in it, hid a few frames among the pages, created the TOC, and exported. There was no other text frame apart from the ones populating the TOC. 

Now, this document, which I'll share later today or early tomorrow, has a mixture of text frames and graphical frames, and it is possible that the TOC is not liking to link to a paragraph style that sometimes is above another text frame and sometimes is above a graphical frame. 

I removed all those hidden frames (btw, not even changing opacity settings helped because then the TOC entry would disappear as well) and arranged some text on certain pages to feed the TOC. I am not completely happy about it but, at least, it works, and the EPUB passes the validation check. 

I will also try, in the next few days, to build a dummy project that would reproduce this issue reliably so that it will be easier for you to investigate. Again, I am not sure what I did was the best I could do, but after 4hrs of failing, I got what I needed for the publishing process. 

Thanks

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 22, 2022 Feb 22, 2022

Copy link to clipboard

Copied

Good evening Uwe,

please find below a trimmed down version of the problematic document. 

The removed pages didn't have any extra frame, nor did they needed to appear in the ToC.

I tried and this file reproduces the exact same issue. 

At the pages shown in the ToC you will find hidden text frames that seem to be the source of the anchoring issue.

I am still not understanding what InDesign wants me to do in order to eventually solve the issue. 

Let me know what you find, whenever you have some spare time.

Thanks!

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
Adobe Community Professional ,
Feb 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

Hi Inélsòre,

I looked into your InDesign document.

Well, the special characters FEFF are indeed there.

At the beginning of the paragraphs that are picked up from the TOC function.

The paragraphs that are in the usually hidden text frames and where paragraph style "ToC entry" is assigned.

 

And of course I can find them with the <FEFF> pattern with Text Find/Replace ( not GREP Find/Replace ). See the screenshot below. So follow Willi's advice and remove them. Then try again to export to EPUB.

 

FoundTextAnchor-SpecialCharacter-FEFF.PNG

 

Note: I did not activate the necessary fonts through Adobe Fonts.

Therefore the pink marks that are indicating a missing font.

 

Regards,
Uwe Laubender

( ACP )

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 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

I tried again but my research returns no match. 

Screenshot 2022-02-23 at 22.04.33.png

Is it possible that <FEFF> is good only in German and that in English it may be something else? What does <FEFF> stands for? 

Second thing: when I first tried to export this it told me I didn't have anchor (I suppose that means those special characters were not there?). Remaking the ToC with the anchor option checked added them, but exporting said it didn't find them.

Deleting both ToC and all frames made the EPUB export successfully. Re-adding the frames and the TOC (with anchors) and exporting failed again.

1) why can't I export an EPUB with frames missing these anchor characters if the ToC was set up without them?

2) why once I add them as requested it says they are missing?  

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
Adobe Community Professional ,
Feb 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

Change the scope to Search: Document

FEFF is the unicode value for that special character.

You can easily select it when you are in the Story Editor window.

Your screenshot is showing it; the one with the two red dots.

 

Regards,
Uwe Laubender

( ACP )

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 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

I really think there is some sort of bug here because anything I do is producing errors. I am now listing my steps one by one, with all alternatives, please tell me what I am doing wrong:

  1. in finished document, create Layer 2 dedicated to the frames which will contain the text necessary to populate the ToC. 
  2. create the necessary text frames with the properly set up Paragraph Style (attached)
  3. create ToC using the set up Paragraph Style (only PDF bookmarks checked, no text anchor—I've never needed this before—attached ToC Settings)
  4. Hide Layer 2 to have those frames disappear as they do not need to appear in the final version.
  5. export EPUB with default settings (attached—I tried also to set ToC navigations to all other available options, no one exports correctly). 
  6. the error I attached in the first answer to Willi appears, asking to updated ToC with text anchors. Not knowing what InDesign is talking about, and never having had this issue before, I comply, updating the ToC with the new option. As a result I see the "column" special character appear in every frame in Layer 2 (I guess expected).
  7. export EPUB with default settings once more
  8. EPUB export warning(s) alert box appears with error "TOC Text Anchor not found: 6" (or 5 before). But how? I've just added them as suggested. 
  9. Interesting thing: if Layer 2 is not hidden, the EPUB exports correctly. 

Do you see any mistake here? 

If I export the EPUB with Layer 2 visible, I get the error in the toc.xhtlm file shown in my previous reply.

You now have the document to test, if you try these steps you should get my same errors. 

Thank you for all your time and help.

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 23, 2022 Feb 23, 2022

Copy link to clipboard

Copied

More errors I cannot explain (I'm just making a book with a ToC, does it have to be that hard?)

Erased Layer2, erased ToC, exported. Succeeded. 

Validated the EPUB, not passed with this error: 

Screenshot 2022-02-23 at 22.25.18.png

Cannot attach an .xhtml, I copied the content into and RTF, but inside the 'ol' dictionary there are as many 'li' elements as there are pages in the document. There doesn't seem to be missing any element.

 

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

There is one more <ol></ol> element without li elements in that code.

 

This may help you to fix the issue:

  1. in the TOC dialog, check "Make text anchor in source paragraph".
  2. in the epub export dialog, do not leave the Navigation TOC empty (this will generate an empty <ol> tag). Change to filename or Multi Level.

 

Test.

Do open the epub in Sigil, because InDesign exports a malformed non-validating epub file. When opened in Sigil it will complain about a malformed epub file, and offer to fix this. Confirm, and save your file.

An additional advantage is that Sigil will compress your epub file, and may reduce the file size considerably depending on the content - in particular when SVG files are embedded.

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 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

Thanks

Could you please also give a look at my post just above the one you replied to (the one with six screenshots attached)?

There I describe my exporting procedure in great detail and would like to understand if there is something I can change to make things better or if it is InDesign breaking things. 

The things that I'm still trying to understand is why a text anchor in an invisible layer counts as not found ... 

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

LATEST

This is a known problem: text anchors in hidden layers fail when exported. Or rather, when you hide things, those are not exported in an epub.

 

In simple words: by hiding those text anchors, obviously during export InDesign throws an error that the TOC entries (which are links) cannot find those destinations. And export fails, of course.

 

It's not a bug, but I suppose you could call it a glitch? Or "intended behaviour" as a developer would call it.

 

In any case, three workarounds:

 

  1. Hide by layer order. Since you have notation sheets imported as images, simply hide the text frames with chapter styles by arranging the layer with images on top of the text frames, and effectively obscuring those from view

  2. Hide by changing the text colour to paper. Select the text lines, and set the text colour to "Paper". This will visible hide the text, i.e.: white on white.

  3. Hide by tiny type size. Change the type size to 0.1pt. It will effectively be invisible, in particular when it is moved to the very right corner of the page.

  4. Combine methods #1, #2, and #3 😉
    (if you do use either method, you will have to define specific paragraph / text styles for the TOC, of course - otherwise your TOC is also affected by the same styling...)

  5. Hide by assigning a CSS class and hide via a CSS rule. I suppose this would be the 'proper' method.


#5 is arguably the best approach, but the most finnicky to set up in InDesign. Here follows how it works:

To hide the text with css, do the following:

  1. create a paragraph style called "hide-me". I duplicated the existing chapter heading style.

  2. In the Export Tagging tab, assign a class called "hidden".
    rayekelfin_0-1645907973151.png
  3. Confirm the paragraph style changes, and assign this paragraph style to your to-be-hidden chapter headings.

  4. Open a text editor. And I mean an actual text/code editor like Visual Studio Code, Notepad++ on Windows, or Text Edit on the Mac.

  5. Create a new file called mystyles.css and save this file in the same folder as your InDesign document project. (This last step is important!!!)

  6. Add the following lines of code:
    rayekelfin_1-1645908409510.png
  7. Save the file and close it. Return to InDesign.

  8. Export your epub. Switch to the CSS tab and point it to that CSS file.
    rayekelfin_2-1645908518782.png

    Click the Add Style Sheet button and locate your mystyles.css file.

  9. Now export your epub. Done. There should no longer be any errors popping up.

  10. Check your epub file in Thorium and the iBook reader. The headings should be hidden from view. (they are still present in the code, though - but that is good, because searching for these chapter headings is now also possible if need be).

 

Consider opening and resaving in Sigil to fix the epub code errors that InDesign's shoddy epub export produces and also compress the epub file properly (which, if you use svg files will reduce the file size by a factor of 9).

 

Or if you don't want to fix those code glitches, run your epub file through eCanCrusher to compress it properly - that way you can use SVG files without worrying about file sizes and Apple complaining about exceeding image pixel dimensions.

 

PS I would use method #6 myself: open the CSS code in Sigil, add that hidden class to the ebook's existing CSS file, and assign that class to all the headings as a second class (chain it to the existing paragraph heading class) in the xhtml pages. 

But then I probably wouldn't be using InDesign in the first place for my epub creation. 😉

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