E-Book Footnotes And Toc Internal Links Broken When I Make A Highlight

In even the latest DevonThink 3 version. If I make a highlight or any kind of annotation to a PDF/Text version of an imported Ebook, it destroys the book’s internal links. All work fine before any annotations are made.

But after an annotation of any kind (highlights, underline, note) then clicking on a TOC link or a footnote link then only goes to the 1st page i.e. the Cover of the book.

Also, sometimes in the past this would also turn the highlights listed in the Inspector pane into nothing but question marks for every alphanumeric character!

Chaos.

Most likely an issue of the PDFkit framework, which version of macOS do you use? And which app created these files?

This happened in both Catalina and Big Sur (now 11.6.8). Calibre was used to create the PDFs. Sometimes from DRMed originals. (Which I paid for, for the record).

The PDF documents created by Calibre are indeed frequently problematic. Does it work after opening the original PDF in Preview, exporting or printing it into a new PDF and finally importing the new file to DEVONthink?

1 Like

Okay experimented with your suggestions with results as follows:

From Preview (Using the Calibre rendered PDF, which works fine in any PDF viewer: TOC is there. Footnotes work.)

  1. “Export to PDF” from Preview: The new PDF’s internal links (TOC & Footnotes) are now text only i.e. broken.
  2. “Print to PDF” from Preview: The new PDF’s internal links (TOC & Footnotes) are now text only i.e. broken, ALSO.
  3. Even “Print to DevonThink3”: The new PDF’s internal links (TOC & Footnotes) are now text only i.e. broken, ALSO.

Normally, I have been dragging and dropping the Calibre-rendered PDF (from the Finder) into DevonThink 3 which created a new PDF located in the default DevonThink3 Database folder.

From within DevonThink3 that PDF HAS the TOC info in the Inspector Panel.
It has functioning internal links for the document page that has TOC links on it.
And the footnote links work also; backward and forwards.
Search works fine.

If then I make annotations they will INITIALLY NOT disturb those internal links. AND the TOC WITHIN the Inspector Panel still remains undisturbed. Search still good. No Question Marks or other weird characters. It all tests fine.

BUT as soon as I quit DevonThink3 when I next re-open all the links are broken as follows: They are not mere text only BUT all the TOC & Footnote links now take me to the Cover Page instead of the correct location. Which is what was happening before.

At least currently there is no return to the ??? Chaos and interestingly the Inspector Panel still has TOC entries that work. Also, navigating the highlights from the Inspector still work which wasn’t the case in some previous DT3 version. Or maybe MacOS version, I have no idea exactly.

Question: Is there some kind of indexing that goes on periodically or maybe is triggered when I quit the program that then fouls up these internal links?

1 Like

It’s the PDFkit framework or Quartz engine of macOS that corrupts the file both when exporting/printing in Preview or editing/highlighting in DEVONthink 3. The only workaround is unfortunately to use an external PDF editor which does not use the PDFkit framework (e.g. Adobe).

I have PDFPenPro and PDFExpert. I think in the past I tried creating highlights with PDFExpert but it had the same problems.

Do you know if those two programs do or don’t use the PDFkit framework or is the very pricey Adobe may only choice?

And can I open Adobe from WITHIN DT3, and highlight in the former or does that mess up DT PDFs as well?

One additional note: different Ebook’s PDFs behave differently. For instance one I was testing this morning works for the first 40 or so Footnotes and then the rest of them (the overwhelming majority) send me straight to the cover. Weird.

This shouldn’t be an issue.

This probably depends on the contents & fonts of the PDF.

WHOA! Here’s another wrinkle:

if you use the OS’s Duplicate command from within the finder window that has your original Calibre PDF and then drag the resulting PDF (which has “copy” appended at the end of the file name) into DT3, guess what?

So far I am able to annotate within DT3 WITHOUT breaking anything.

I will test further but stay tuned…

UPDATE

Curiouser and Curiouser

The above operating procedure was tested on 5 E-books from the same publisher all rendered as PDFs by Calibre.

3 books worked. Annotations (from within DT3, not an external program) do not screw up the internal links.

1 book maintained the links BUT despite being identified as a PDF/TEXT file like the others had all annotation functions grayed out. I then used “Open With” to open the file in PDF Expert to highlight a few sentences (with both DT3 and PDFExpert running simultaneously) and they showed up back in DT3 AND the link navigation still continued to work.

The fifth book began failing in the same way as originally described above in this thread.

I then decided (after updating to Calibre 6.5.0, today’s new version) to recreate via Calibre the PDF from the original kindle file. Then I dragged that into DT3 again. Result: Almost all working EXCEPT The TOC in the PDF (not the one in the Inspector Panel, which continues to keep working even after annotations) will randomly turn into text only instead of active links, blue and underlined. IF I then use the Inspector Panel’s TOC to navigate elsewhere, when I return to the in-context TOC the blue and underlined links are back, fully functioning.

Oops: Wrote too soon. This fifth book has only the first or so footnotes working. The rest simply don’t react to clicking at all. (They don’t go to the cover page like the original malfunction. Or anywhere else.)

LASTLY: This particular publisher does NOT have any DRM on their books but supposedly has invisible watermarks that would identify the source of any re-distribtion which OF COURSE I am not doing or intending. Just trying to make fair use in DT3 of purchased materials licensed to me personally and being tortured for the effort.

I was wrong to describe them as Kindle books (implying they were in MOBI or AZ3 or whatever it is.) I purchased them direct from the publisher and their downloads have the extensions “.epub”

I will continue experimenting, next with other publishers’ books.

Please compress a known problematic Calibre exported PDF. Then hold the Option key and choose Help > Report bug to start a support ticket and attach the PDF for us to inspect.

Thanks!

Done. Thanks!

I’ll stop after this brief update (which I also forwarded to the support ticket):

ANOTHER UPDATE:

Footnote links stopped working in one of the three books that were initially fully functional. BIZARRE