Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot View or automatically download PDFs in Safari 7.0

This is a bizarre problem since the Safari 7.0 update. If I click on a link for a PDF, instead of downloading the PDF and opening Acrobat or Preview, I just get a page of the underlying code.


E.g., clicking on http://images.apple.com/media/us/osx/2013/docs/OSX_Mavericks_Core_Technology_Ove rview.pdf


gives me:


%PDF-1.5 %âãÏÓ 1101 0 obj <> endobj xref 1101 29 0000000016 00000 n 0000002539 00000 n 0000002690 00000 n 0000003122 00000 n 0000003237 00000 n 0000004185 00000 n 0000004648 00000 n 0000004761 00000 n 0000005026 00000 n 0000005537 00000 n 0000006159 00000 n 0000006419 00000 n 0000007050 00000 n 0000017804 00000 n 0000025298 00000 n 0000025328 00000 n 0000025454 00000 n 0000025490 00000 n 0000025567 00000 n 0000039803 00000 n 0000040145 00000 n 0000040214 00000 n 0000040332 00000 n 0000040409 00000 n 0000040687 00000 n 0000043992 00000 n 0000103676 00000 n 0000002338 00000 n 0000000876 00000 n trailer <<7ECE529081E14E87910F79877C04D8A0>]/Prev 4452637/XRefStm 2338>> startxref 0 %%EOF 1129 0 obj <>stream hÞ´T&#127;P’g ÿ>€ ˆ &#144;” …° ašÓrˆŒÈ• ™3ónh&#157;Õ•— ×&#143;[5TÒ—Ê™^®U¶ uYËSS7·öC·Ì~l&#157;m-]k7ÙêÔ®:-k»vÝíá ”ÖþÝóÜËû}>ßïçûóá í;ðÿTàÁÔâAÞ4 wÁM@tð³@6Ò U0w#€…¿QEÕ`–¡%ÈY ˜ ,©ˆÊ c~ 7õ¬Žˆr{à1 Ô >Ÿ; D#P¶Íy Z ¬ p²•ÙÊÉy¾=ûíyÐ× ø ´« [øÙ†²¨ª°Ð&#157;ÜY ÷ÏTéÆËzm¡ŠÌêz-‹?GwC8•#¯†Êâ%T#8©=”]_Þ/J6ÓS/×й‚!ûï ɲ BÞ 6YßVZiW &#141;N8/ º Iš¾ALþô +úí¼M¦Nä »Y&#141;y$X¨/ s£ Ùä *gvnEÚ~Qè.çÍåaíù‚4MŸÅê_) öä ¡²[4ið ûÑÚÒTbS‘±s_ª&#141;]=ÿÎRC ýîy»£ÄžYÈ Ï¯‹H ‹e?œÄº¡¼ÒfÓg9½1·˜kÍ&#127;uÈ‚Î d¼Ñ«E"N£æÁ CŽ’ã Oy c ûÕCƒ Zò ‰’&§•òëÕƘig lC_@†CµÉäá™]ñšó Q* ÉMÎ 4Y¦±m•oEž ã¿ŒD÷ Õ»œ c‚ÅVœ™KW)—¦¯þjÛø});²'ÁüŒ£ : 謶* ¥R>ëÔ+ •l&#144;]‚] ™‘¹äDÒ žba«ýõ×h£ã:}x ‹®s`ÝN傦z ÷Z t€p»ÖÖrîž óc í&#143;{ ¬LÜeäù÷–¹ Ç ™©©å«¤Áû’÷B{Þä ‹žñ(• \‘xM Ô§ÙÎ ^’+À&õy/Ìo˜m&#143;—™:A ಼TSïæ]äÛI×t?œgz¤Úbh QñTpfU‰[nËLë ɳ™ÔüŸÎ Éú0(ä-5t%˜ ²iáÁ µkÄÚZ¶¢'3&#144;ï ± ÌjK[ÐtHÎ÷Î&#157; ¤ 95÷¶ q7½Áÿ¢Œ´¬ŽÒ²éúîku®¬ó¿u݉!‹¡QcvNÈü¼ 4µáÛÙøÒþ|I ¹¯tbñ•?7æ|YÐûUd½à è“¢G@ &#141;îÅؤìÎÈÝ"¾·?4&#141;ÛÀó}! äA =ÕE WüŸ2f¿ä ÷’ði¿×/W åMÛ»þ¿ï) x æÓßÁïéøÙL¦ lT ÙÔ#¨ ²à!ºCY £”ÜÙà 1@…5Àå ” rX Jø›um” b Cà #i@ 0 O N ExN ”bJê v Gè :&#141;G² óâBk°ö)0Y `h&#143;Á^x @ lƒÝ oÁ ˆÃ» Î (etc.)


I get pages of this code.


If I do a "Save As" of this page in Safari, then it saves it as a proper PDF, viewable by any PDF reader. This happens on all PDFs, not just Apple's. I installed Mavericks and Safari 7.0 at the same time, so I don't know when the problem began. This happens on both my iMac and MacBook Air. I changed the default viewer from Acrobat to Preview, but it did not help.


I feel like I've been transported back in time 15 years when this is how files were exchanged...


Any ideas?


Running:

  • Safari 7.0
  • OS 10.9 Mavericks


on

  • iMac i7
  • MacBook Air i7

OS X Mavericks (10.9)

Posted on Oct 24, 2013 5:15 PM

Reply
44 replies

Oct 28, 2013 12:32 AM in response to cm477

I've been having the same problem as you since acquiring Safari 7.0 when I downloaded Mavericks. I have been following the replies and suggestions to your post ever since. I have implemented all the suggestions you received without success. In addition, I have tied a few "solutions" of my own, also without success.


A few minutes ago, I noticed something unusual. In Safari Preferences>Advanced there is an option to "Stop plug-ins to save power". To find out more, I clicked on the "?" at bottom right. This brings up the Safari Help page which says"----

Stop plug-ins to save power

Freezes plug-ins after a brief time. You can click frozen plug-in content to start the plug-in for a website. The plug-in stays enabled for that website, though other instances of the same plug-in on the current webpage remain temporarily frozen until the page is loaded again. Safari automatically disables plug-ins for a website you don’t visit for a few weeks.

To see a list of websites that currently start plug-ins automatically, click Details. Then remove websites from the list to save power.

But the thing is there is NO button/link called "Details" on that page in Preferences, to click. I assume this option is mostly relevant for Laptops running on batteries rather than Desktops running on mains power - none the less, the option IS there in Safari 7.0 whether your using a Laptop or Desktop.

Is this somehow contributing to the problem ?

Oct 28, 2013 11:20 AM in response to Linc Davis

I tried logging into my Guest account (and other pre-existing user accounts on my computer), and I am able to view PDF from within Safari, download them, and view them in Preview. So the problem is specific to my user account.


I am guessing that "garylapointe" has the same problem I have. I set Safari to download PDF's immediately, and then I would view them with Adobe Acrobat (in my case). I often have to download multiple PDF's in my research, and this is the most effective way for me to work. I cannot remember how I set up Safari to download rather then open up PDF's within Safari (I did this years ago). I wonder if I reverse this action, it will at least open back up in Safari.


Instead of PDF's being downloaded, I am getting just the underlying text code. If I save this, then it will save as a PDF which I can open with Acrobat and Preview.


I also tried installing Adobe Reader, but I still only get the text code when clicking on a PDF link.

Oct 28, 2013 1:00 PM in response to cm477

Read this whole message before doing anything.


Back up all data.


Quit Safari if it’s running. Then select


Force Quit…

from the menu bar. A small window will open with a list of running applications. Safari may appear in that list, even though you quit it. If so, select it and press return. Close the window.


Step 1


In the Finder, press the key combination shift-command-A to open the Applications folder. Select the Safari icon in that folder and press the key combination command-I to open the Info window. There’s a checkbox in the Info window labeled Open in 32-bit mode. Uncheck it, if checked. Close the Info window and the Applications folder.


If Adobe Flash Player is installed, select

 ▹ System Preferences ▹ Flash Player Advanced

and click Delete All. Close the preference pane.


Hold down the option key and select

Go Library

from the Finder menu bar. Delete the following items from the Library folder (some may not exist):


  • Caches/com.apple.Safari
  • Caches/com.apple.WebKit.PluginProcess
  • Caches/com.apple.WebProcess
  • Caches/Metadata/Safari
  • Preferences/com.apple.WebKit.PluginHost.plist
  • Preferences/com.apple.WebKit.PluginProcess.plist
  • Saved Application State/com.apple.Safari.savedState


Leave the Library folder open. Try Safari again. If it works now, stop here. Close the Library folder. If you still have problems, continue.


Step 2

Triple-click anywhere in the line below on this page to select it:


open $TMPDIR../C


Copy the selected text to the Clipboard by pressing the key combination command-C.

Quit Safari again. Launch the Terminal application in any of the following ways:


☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.


Paste into the Terminal window (command-V). I've tested these instructions only with Safari. If you use another browser, you may have to press the return key after pasting. A folder should open. Delete the following items from the folder, if they exist:


  • com.apple.Safari
  • com.apple.WebProcess+com.apple.Safari


Quit Terminal. Close the folder. Launch Safari and test.


Step 3


If Safari still doesn’t work right, quit, go back to the Finder and move the following items from the open Library folder to the Desktop (some may not exist):


  • Cookies/Cookies.binarycookies
  • Internet Plug-Ins
  • Preferences/com.apple.Safari.LSSharedFileList.plist
  • Preferences/com.apple.Safari.plist
  • Preferences/com.apple.Safari.RSS.plist
  • Preferences/com.apple.WebFoundation.plist
  • PubSub/Database
  • Safari


(Note: you are not moving the Safari application. You’re moving a folder named “Safari.”)


Try again. This time Safari should perform normally, but your settings and bookmarks will be lost. The default set of bookmarks will be restored. Delete them all.


If the issue is still not resolved, quit Safari again and put all the items you moved to the Desktop back where they were, overwriting the newer ones that may have been created in their place. You don’t need to replace the files you deleted in step 1. Stop here and post again.


If Safari is now working normally (apart from the lost settings), look inside the “Safari” folder on the Desktop for a file named “Bookmarks.plist”. Select

File Import Bookmarks

from the Safari menu bar. Import from that file. Recreate the rest of your Safari settings. You can then delete the items you moved to the Desktop.


Note: This step will remove your Safari Extensions, if any, and their settings. If you choose to restore them, do so one at a time, testing after each step to make sure you haven’t restored the problem.


If you don’t like the results of step 3, you can undo it completely by quitting Safari and restoring the items you moved or deleted in that step from your backup, overwriting any that were created in their place.

Oct 28, 2013 9:29 PM in response to Linc Davis

I did remove the Internet Plugins from the Library Folder and relaunched Safari, but it did not work.


However, I did figure out how to display PDF's in Safari again (the default behavior), rather than the underlying plaintext code.


I looked around for instructions on "How make Safari download PDF files instead of opening them in-page?" and I found this link: http://apple.stackexchange.com/questions/57039/how-make-safari-download-pdf-file s-instead-of-opening-them-in-page


I saw what terminal command was suggested, and I basically did the opposite of what they recommended (instead of "YES," wrote "NO"). So basically:


  1. Copied the Terminal command:
    defaults write com.apple.Safari WebKitOmitPDFSupport -bool NO
  2. Pasted the above command at the Terminal prompt.
  3. Closed Safari
  4. Restarted Safari


I then clicked on a PDF link and now the PDF opens within Safari rather than the gibberish code I was getting. While this default behavior for handling PDF's is not what I prefer, it is a start.


Just to test, I tried entering the Terminal command to make Safari download PDF's as indicated in the link (i.e., "YES" at the end of the command instead of the default "NO"), but this just resulted in PDF's links opening up pages of code again rather than displaying the PDF correctly. My guess as a non-programmer layperson is that Apple changed Safari 7.0 so this command no longer works to make Safari download PDF's. Hopefully someone figures out the correct command to make this work again.


I'm not sure if my original question is answered, but this is a step forward. Thanks for everyones' help.

Oct 28, 2013 10:06 PM in response to Linc Davis

Linc: I removed all the files as you suggested, keeping in mind that you said some files "may not exist." It turns out that at least two files do not exist in my user account, but they do exist on other user accounts on the same computer:


  • Preferences/com.apple.WebKit.PluginHost.plist
  • Preferences/com.apple.WebKit.PluginProcess.plist


Does this explain this strange behavior? Would it make sense to copy these files from the other user account and place them in my current account to see if Safari still displays PDF's correctly within the browser, and-- more importantly to me-- if I can make the terminal command work again to download PDF's rather than displaying them in Safari?


My User Account had been in use for many years, and has probably been corrupted in many ways (I am a sort of wanna-be power user). I haven't tried starting over using a fresh account because I have large iPhoto and iTunes libraries that I don't want to lose all the organization and edits of the last 10+ years.

Oct 28, 2013 10:50 PM in response to cm477

In a second user account ("Account2") in which Safari worked normally, I decided to try the shell command that used to force Safari to download PDF's rather than displaying them within the browser. So, in User Account2:


  1. Copied the Terminal command:
    defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES
  2. Pasted the above command at the Terminal prompt.
  3. Closed Safari
  4. Restarted Safari


Now when I click a PDF link, I get gibberish code instead of a PDF displaying or download.


So it seems that this shell command no longer works in Safari 7.0 as it did in previous versions of Safari. It's too bad, because for me, it is more of hassle to view PDF's within Safari than directly with Acrobat.


(I changed the shell command to "NO" and Safari once again displayed PDF's within the browser as is the default mode.)

Oct 29, 2013 1:14 AM in response to cm477

I can reproduce this behavior both in my account and in a new created accout. I removed now the Adobe Reader plug-in and got the same problem back.


A work-around is to hold the option when you click on a pdf link, this lead always to a download.

I didn't found another documentation yet how to enable pdf download.


In general i think this is a bug and i would open a radar on it ... or did somebody else?


PS: I found this bug report https://bugs.webkit.org/show_bug.cgi?id=118858 it seems there is a new PDFPlugin.

Cannot View or automatically download PDFs in Safari 7.0

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