Weird behavior I am trying to understand

  • Thread starter Thread starter BillTre
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 370 views
Messages
2,831
Reaction score
12,429
I have a 2024 MacBook Pro (M4 chip) running Tahoe 26.5.2.
When I copy text out of a pdf in Preview version 11 (1113.5.3)the letters copied are shifter to different letters. The letters are changed to different letters. If used in a search in the document, it finds the original word.

Here is an example, copied text in the search field is from the green highlighted text in the pdf.

Screenshot 2026-07-22 at 5.46.41 PM.webp


These changes do not happen if the same text is copied from the document on line.
It only seems to happen for me when copying from pdfs from the Nature family on journals.

Very curious.
Interested to hear people's thoughts on this.
 
Physics news on Phys.org
Almost certainly how the document was encoded / some flaw there in. Are there any outstanding updates for your pdf reader though? If you open same pdf in a different reader do you get different results? That would help troubleshoot it a bit more.
 
Reply
  • Like
Likes   Reactions: BillTre
I've seen docs that look okay but when you select text it reverses the letters.

An example, selecting the word “smart” and you “trams”.

—- From a ChatGPT search —-

Nature’s PDFs are standard PDF files, but they often have characteristics that make them harder for software to extract text cleanly:
  • Embedded font subsets. Nature frequently embeds only the glyphs used in the paper, with custom font names (for example, ABCDEE+TimesNewRoman). This is standard PDF practice and reduces file size.
  • Custom character mappings (ToUnicode tables). These map the embedded glyphs back to Unicode. If the mapping is incomplete or unusual, some PDF extraction tools produce garbled characters or missing symbols.
  • Vector equations and figures. Mathematical expressions may be stored as vector graphics rather than text, so copying them can fail or lose formatting.
  • Multi-column layout. Like most scientific journals, Nature uses a two- or three-column format, which can confuse text extraction algorithms and produce text in the wrong reading order.
  • Ligatures and special symbols. Characters such as “fi”, “fl”, Greek letters, and mathematical symbols may be encoded in ways that simpler PDF readers don’t interpret correctly.
So Nature is not using a proprietary or secret PDF encoding.

Their PDFs conform to the PDF standard, but their typography and production workflow are sophisticated enough that older or simpler PDF parsers sometimes struggle.
 
Last edited:
Reply
  • Like
Likes   Reactions: BillTre
Preview (Apple pdf reader) is up to date.
Opened the same file in PDF expert, which I don't think is up to date of at least new, and got the same behavior.
 
This sounds similar to a problem I encounter sometimes. When I do a find for text in a document and the text it finds has no resemblance to the text I wanted.
Could they be related?
Sorry, I don't remember any details about if it was a PDF or a website.