Cannot highlight certain pdf documents

Thanks for your reply, @rmschne

I can toggle the hidden preference, but it didn’t work after clicking the On icon.

And I have also tried to enable the option ForceEditablePDFs in terminal with the command below, but it didn’t work either:

defaults write com.devontechnologies.think3 ForceEditablePDFs -bool TRUE

Certain PDFs open in DEVONthink cannot be highlighted as these menu items are not clickable. Also, OCR PDF in DEVONthink didn’t work for me, but OCR PDF in Acrobat worked for me. Hope it would be helpful to diagnose the issue.

Please send such a file to cgrunenberg - at - devon-technologies.com. In addition, which macOS version do you use?

Hi, @cgrunenberg

Many PDFs in my database cannot be highlighted with DEVONthink, even though they have been OCRed with DEVONthink, such as this one below:

ocr-with-devonthink-but-cannot-highlight.pdf (628.7 KB)

And my device is a Mac mini 2020 running macOS 13.2.1, thanks in advance.

FYI, highlighting in Apple Preview does not work here, whereas it works with PDFPen. Different underlying PDF technologies in use. My hunch is DEVONthink uses same PDF technology as Apple uses in Preview. (might be mistaken).

So being pragmatic … recommend you use PDFPen or Adobe Acrobat to move on with your work now.

The correct command is…

defaults write com.devon-technologies.think3 ForceEditablePDFs -bool TRUE

…and works as expected. However, editing (e.g. highlighting) breaks the text layer due to PDFkit issues, therefore this workaround isn’t useful in this case.

Thanks, it worked perfectly! (I copied the command from the PDF manual. It’s embarrassing the hyphen was truncated automatically :sweat_smile:)

BTW, what’s the side effect for the breaking of the text layer?

The text will be gibberish, i.e., seemly random characters, and unsearchable.

Both indeed use Apple’s PDFKit. PDF Expert does not.

After turning on the option ForceEditablePDFs, I encountered the same issue discussed below: OCR layer disappeared.

I guess the cause is the annotation within DEVONthink as previously they worked well when annotating with PDF Expert. Even though this is a bug of Apple PDFkit, please come up with a workaround.

Now my whole database with thousands of PDFs are at risk, which is really annoying :upside_down_face:

Is the text layer DELETED from the PDF, thus putting your PDFs at risk, or using an app that does not use Apple’s PDFKit, e.g. PDF Pen, PDF Expert, or Adobe Acrobat also does not work?

That’s why this hidden preference is disabled by default, there’s a reason why DEVONthink marks certain PDF documents automatically as read-only. The internals of the PDFkit on the other hand have to be fixed by Apple unfortunately.

1 Like

Yes, the text layer was deleted from PDF completely, and any PDF reader including DEVONthink, PDF Expert, Preview cannot detect the text in the PDF.

Unfortunately this is probably the cause:

You’re correct. Let’s hope Apple can fix the issue as soon as possible.

At present, I have to avoid annotating PDFs with DEVONthink, unfortunately.

PDFs created by macOS (e.g. via PDF services or exported by other apps using the Quartz engine) or not containing any Asian characters shouldn’t cause any troubles usually.

1 Like

Can PDF Pen or Adobe acrobat detect the text layer? (both use different technology).

Do you see updated “modified dates” on the changed files?

Unfortunately, many PDFs that I was working recently in my database are OCR PDFs, and a majority of them are Chinese books :upside_down_face: But anyway, thanks for your reply and hard work. Hope this issue can be fixed ASAP.

The text layer can not be detected by Adobe Acrobat either. (I don’t install PDF Pen).

To be honest, I didn’t notice the “modified dates”, but this info may update when I annotate PDF in DEVONthink.

Can you start a support ticket and attach a problematic PDF? Thanks!

Thanks for your patience. I have submitted a support ticket.

After a PDF was added in my database, the log file showed “Tranferring attributes skipped to avoid corrupting text layer”. What does it mean, is it related to the issue here?