9:55 PM
Q: Preview freezes on clicking inside (very small) PDF files

knzhouI have a bunch of small PDF files, which are a few hundred pages but generally less than 2 MB or so in size. Scrolling is perfectly smooth in Preview.app, but if I click anywhere inside the PDF, macOS freezes for a couple seconds. The issue is perfectly reproducible and happens every time for cer...

Do you have a tool selected? What happens when you have no tool selected and you use the other type of selection (text vs. rectangular)? Can you upload a sample PDF that does this?
@timothymh I've had no tool selected, but it does this reliably for both text and rectangular selection, as well as any tool I tried. (It doesn't happen again after the first time, until Preview is quit and reopened.) Here is a link to the smallest file I found that does this, though here the freeze is only for one second. For other files the freeze is up to 5 seconds complete with spinning beach ball.
Hm, it's not freezing for me. What version of macOS are you running? What happens when you download a copy of the file you just uploaded and try to open it? Is the file on an internal drive?
@timothymh Yup, still happens after downloading a copy. It's on my hard drive (SSD), not on anything external. I'm on Sierra, 10.12.6.
Pardon the obvious question, but have you tried rebooting? :) What is the source of these files; did they all come from the same place?
9:55 PM
@timothymh I just rebooted and still get the exact same result! The files are from a variety of places, but it even happens on some files I created myself (for personal notes). The only common link is that all of them contain a lot of LaTeX.
welcome to Ask Different, by the way :)
Okay, what happens if you export it from Preview and open the exported PDF?
thank you!
i just tried that, and the new PDF has the exact same issue.
let me give you a link to a better example, this one hangs for 5 seconds:
Still nothing for me, and I'm on exactly the same version as you.
Do you have any TeX software installed which has plugins that might be affecting Preview?
i believe not.
is there any way i can simulate having a 'clean' system?
For certain types of thing, yes, but I'm not sure if they would be relevant here. It's absolutely worth a try though:
One way is to enable the Guest account in system preferences and log into that. This will negate any of your user settings. Another thing to try is Safe Mode, which doesn't launch any unnecessary processes when you boot/log in. You can enter Safe Mode by rebooting and holding Shift until you see the login screen.
Keep in mind that for Guest mode you will need to have the file in a location that you can access from another account.
I'll keep brainstorming; let me know if anything changes when you try those.
10:09 PM
Okay, I just went into safe mode; it looked incredibly weird (laggy, some graphical artifacts) but the problem didn't occur!
I'll try the Guest thing now.
Thanks again for all the help!
Switched to Guest and there's no freezing at all.
That's super weird, I've barely installed anything and have no idea what the cause could be.
Is there a way to do process of elimination here?
Okay, progress!
You mentioned you made some of the PDFs yourself, so you must have a LaTeX editor of some sort?
What is its name?
It's Sublime Text, with the LaTeXing package.
(My default LaTeX installation also came with TeXshop, though I never use it.)
Oh, okay. That would be surprising if that was the issue then; Sublime packages are pretty sandboxed within Sublime Text.
Can you open Activity Monitor and see if any processes have "tex" in their name, or are otherwise TeX-related?
I assume you're back in your account, in normal mode?
just did it, no results for a search for 'tex', looking through manually now...
I don't think I see any TeX stuff in there.
Thank you for this interesting problem, by the way, I love troubleshooting haha :)
Hm, okay.
10:19 PM
it also might not be TeX -- i just read a ton of math/physics stuff so just about everything i have is TeX.
Good point, we should try to test that.
however, it only happens on pdf files which have actual text to select.
i have some large PDF files which are essentially just images of scanned pages, the issue never happens for them.
Do you have Adobe Acrobat?
acrobat reader.
Ah, that would't be sufficient. I was going to propose some editing.
Is the one you sent me the shortest that makes Preview hang?
10:23 PM
the first link i sent (Dyson, QM) is the shortest. the second link i sent is the worst example.
Does the delay seem to entirely correlate with length?
should i try concatenating some of these problematic files?
You could; is there something you hope to test by doing that?
just to see if the problem continues to grow with size.
sure, might as well
I'm going to try an experiment on my end, might take a little while.
10:34 PM
I just concatenated Morin (the worst case) to itself and now the freeze is almost exactly twice as long. So it definitely is length-dependent.
Thanks so much for your help!
I actually have to sleep soon, I have classes early tomorrow morning (yes, on Saturday!).
Can I come back in about 12-24 hours?
Yikes! Okay, I'll finish making these test files and upload them when I'm done. We'll talk more tomorrow, presumably :)
awesome, thank you! :)