Preview Glitch: Accidentally Highlighting the Entire PDF

Toggling the highlighter button (e.g., the red underline) and accidentally pressing Cmd+A causes the entire PDF to turn red. This may happen, for instance, when trying to save the file (Cmd+S).


The glitch is that you cannot undo it (with Cmd+Z), nor does the inspector tool have a single-line entry for the highlight. Therefore, the only choice left is to manually remove highlights. This can be especially infuriating for a large PDF with important highlights (e.g., a textbook) that cannot be recovered.


Another glitch is the Inspector tool itself. The sorting by a column, say the Date column, is a bit crazy and all over the place.

Posted on Feb 3, 2025 1:40 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 27, 2025 9:36 AM

I just deliberately did this on a 4-page PDF and with the entire content of the PDF now red highlighted, I pressed cmd+I to open the Inspector. On the Inspector toolbar, I clicked the last entry which listed annotations on the PDF. I had four entries (for each page) and by pressing and holding the cmd key, I selected each of the Highlight annotation entries and then pressed the backspace key. All red highlights disappeared from the PDF.

7 replies
Question marked as Top-ranking reply

Feb 27, 2025 9:36 AM in response to HedgehogsConspiracy

I just deliberately did this on a 4-page PDF and with the entire content of the PDF now red highlighted, I pressed cmd+I to open the Inspector. On the Inspector toolbar, I clicked the last entry which listed annotations on the PDF. I had four entries (for each page) and by pressing and holding the cmd key, I selected each of the Highlight annotation entries and then pressed the backspace key. All red highlights disappeared from the PDF.

Feb 27, 2025 10:13 AM in response to VikingOSX

If the PDF already has some selected text with a red highlighting that you want to preserve, and then the entire PDF is made that highlight color, there is no magic solution to removing just the unwanted red highlight. The Apple PDFAnnotation framework is aware of an annotation modification date, so it might be programmatically possible to filter annotation removal based on that specified date. I haven't attempted this yet.


I have an AppleScript that given the selected PDF, can remove all annotation highlights in the PDF. It certainly works on a PDF so inflicted with an ⌘A highlight treatment where a solid block of the same highlight is removed. There is no means to remove a highlight of a specific color, preserving other highlights in the PDF.

Feb 27, 2025 10:42 AM in response to VikingOSX

I just placed two red text annotations in a PDF and can programmatically get their modification date string.


Where this would be feasible in a PDF that has accidentally been set to all red annotations, is if the date/time of existing preserved red annotations is older than the accident highlights modification date string. In theory, one can produce and sort a list of all annotations, removing those whose date is newest.

Feb 27, 2025 1:02 PM in response to HedgehogsConspiracy

HedgehogsConspiracy wrote:

Yes, that would be perfect. I'm assuming you spread the annotations across pages?

Didn't matter in my test case for obtaining the modification date of the highlight annotations. I could have spread annotations across multiple pages and I could get the page number and the modification date of the Highlight annotation on each page if I had bothered to take the time.



Ideally, it's as simple as an ordinary 'undo operation' (Cmd+Z) — only that we're undoing an accidental annotation spread across many pages.

I read your explanation of what goes on behind scenes. Why is 'undoing' so much harder for a large annotation, versus a small one? Also, why wouldn't the inspector let us just sort the entries in descending order? In any case, would be super helpful to see your script!

The Preview development team only designed a capability to show all annotation types on a given page by ascending page, and ascending modification date order per given page. There is no means to alter this built-in order.




Feb 27, 2025 11:07 AM in response to VikingOSX

Yes, that would be perfect. I'm assuming you spread the annotations across pages?


Ideally, it's as simple as an ordinary 'undo operation' (Cmd+Z) — only that we're undoing an accidental annotation spread across many pages.


I read your explanation of what goes on behind scenes. Why is 'undoing' so much harder for a large annotation, versus a small one? Also, why wouldn't the inspector let us just sort the entries in descending order? In any case, would be super helpful to see your script!


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Preview Glitch: Accidentally Highlighting the Entire PDF

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