Too long, don’t want to read.
- Symptom. Cutting and pasting sections of PDF files from macOS / OSX Preview results in fuzzy and pixelated images where you were expecting vector PDF data to be copied and pasted.
- Correlated symptom. You will be able to get vector data if you copy and paste an entire page instead of a selected region of a page.
- Diagnosis. There was an app hijacking the “com.adobe.pdf” uniform type identifier (UTI). This resulted in many equivalent types not being recognized as valid PDF data on the clipboard.
- Current fix. Identify uninstall the app by looking through the UTI registration database with lsregister. To identify the app …
- find the line-number of the lsregister -dump that has the currently active mapping for “com.adobe.pdf”
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/\ lsregister -dump | grep -n -A 2 "uti: com.adobe.pdf"
- For me, this showed (with some wordpress induced spacing issues)
36795: uti: com.adobe.pdf 36796- description: Portable Document Format (PDF) 36797- flags: imported inactive core apple-internal trusted -- 49934: uti: com.adobe.pdf 49935- description: PDF 49936- flags: exported active trusted # this is the problem! -- 49990: uti: com.adobe.pdf 49991- description: PDF 49992- flags: imported inactive trusted -- 74076: uti: com.adobe.pdf 74077- description: (null) 74078- flags: imported inactive trusted -- 77680: uti: com.adobe.pdf 77681- description: PDF Data 77682- flags: imported inactive untrusted
- This indicates it’s line 49934 that has the active mapping, whereas we wanted it to be on line 36795, which is the internal apple mapping with all the appropriate metadata. So now we need to guess at the file that this implicates. Here is my current way to do this. This isn’t entirely reliable, but I think it should work in most cases.
# This command shows the last 10 "apps" before the offending # uti type definition, the last one should be the app # that is causing the problem. /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/\ lsregister -dump | head -n 36795 | grep "CFBundleExecutable = " | tail -n 10 CFBundleExecutable = "Pass Viewer"; CFBundleExecutable = "Google Chrome Helper"; CFBundleExecutable = "Photo Library Migration Utility"; CFBundleExecutable = GarageBand; CFBundleExecutable = PIPAgent; CFBundleExecutable = PowerChime; CFBundleExecutable = "Problem Reporter"; CFBundleExecutable = gephi; CFBundleExecutable = rcd; CFBundleExecutable = Notability;
- So the offending app is likely to be Notability.
- I uninstalled Notability and everything resumed it’s normal behavior regarding copy & paste after I reset the UTI database.
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/\ lsregister -kill -seed -r
- (Then I reinstalled Notability and everything was bad again!)