Richmondo

Q: why does Safari show code when I open a pdf?

I think I remember Preview opening when I clicked on a PDF link. Now, Safari just shows the code. What can I do to fix this, besides using a different browser?

MacBook Pro (13-inch Early 2011), iOS 7.0.3

Posted on Nov 13, 2013 11:02 AM

Close

Q: why does Safari show code when I open a pdf?

  • All replies
  • Helpful answers

  • by pedro d,Helpful

    pedro d pedro d Nov 15, 2013 8:29 AM in response to Richmondo
    Community Specialists
    Nov 15, 2013 8:29 AM in response to Richmondo

    Hello there, Richmondo.

     

    The following Knowledge Base article, although archived, is still practical for Mavericks:

     

    Mac OS X: Double-Clicking a File Opens the Wrong Application

    http://support.apple.com/kb/TS2291

    To open a document once

    1. Click the document's icon in the Finder to select it.
    2. Choose File > Open With.
    3. Choose the desired application. You may choose Other to select an application not on the list.

     

    To configure documents of this type to open with a certain application

    1. Click the document's icon in the Finder to select it.
    2. Choose File > Get Info.
    3. Click the disclosure triangle next to "Open with:".
    4. Choose the desired application from the "Open with" pop-up menu. You may choose Other to select an application not on the list.
    5. Click Change All.

    Thanks for reaching out to Apple Support Communities.

     

    Cheers,

    Pedro.

  • by Richmondo,

    Richmondo Richmondo Nov 16, 2013 7:48 AM in response to pedro d
    Level 1 (0 points)
    Nov 16, 2013 7:48 AM in response to pedro d

    I checked and my pdfs are set to open in Preview. This issue is Safari-specific. Instead of opening preview to display a pdf, Safari shows the raw code of the pdf.

  • by leroydouglas,

    leroydouglas leroydouglas Nov 16, 2013 8:13 AM in response to Richmondo
    Level 7 (23,937 points)
    Notebooks
    Nov 16, 2013 8:13 AM in response to Richmondo

    A problem with your Adobe Reader Plug-in.  Try disabling it / deleting it or reinstalling.

     

    http://helpx.adobe.com/acrobat/kb/troubleshoot-safari-plug-acrobat-x.html

     

    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10

     

    A work around is right (control) click  your PDF link,  and choose to download it.

     

    pic.png

  • by VikingOSX,

    VikingOSX VikingOSX Nov 16, 2013 8:42 AM in response to Richmondo
    Level 7 (21,309 points)
    Mac OS X
    Nov 16, 2013 8:42 AM in response to Richmondo

    You have two in browser PDF viewing options, providing you haven't removed the Apple Quartz Composer webplugin from /Library/Internet Plug-Ins:

     

    1. Install Adobe Acrobat Reader 11.0.04 and let it upgrade its PDF plugins in the above folder. The Adobe PDF plug-ins will supercede the default Apple PDF plug-in.
    2. Perform the above, and then move the following two files from the above folder (adminstrator password), allowing Apple's PDF plug-in to function:
      1. AdobePDFViewer.plugin
      2. AdobePDFViewerNPAPI.plugin
  • by andyBall_uk,

    andyBall_uk andyBall_uk Nov 16, 2013 10:41 AM in response to Richmondo
    Level 7 (20,495 points)
    Nov 16, 2013 10:41 AM in response to Richmondo

    Quit Safari, Open Terminal (/Applications/Utilities) & copy/paste the following line, then press enter.

     

    defaults delete -app Safari WebKitOmitPDFSupport

     

    Don't install Adobe Reader's plug-ins unless you need them for the relatively few pdf's that won't display in Safari or Preview.

     

    WebKitOmitPDFSupport used to make Safari download pdf files rather than try to display them - the latest version doesn't handle that & displays them anyway, but as raw data.

  • by Max Killen,

    Max Killen Max Killen Nov 16, 2013 4:22 PM in response to andyBall_uk
    Level 1 (26 points)
    iCloud
    Nov 16, 2013 4:22 PM in response to andyBall_uk

    This fixed my issue.  Thanks!

  • by Rydadio,

    Rydadio Rydadio Nov 16, 2013 8:01 PM in response to Richmondo
    Level 1 (0 points)
    Nov 16, 2013 8:01 PM in response to Richmondo

    None of your suggestions solved the problem. It turns out the problem was caused by a Safari Extension. issue resolved.

  • by andyBall_uk,

    andyBall_uk andyBall_uk Nov 17, 2013 6:00 AM in response to Rydadio
    Level 7 (20,495 points)
    Nov 17, 2013 6:00 AM in response to Rydadio

    Do tell us what the extension was - it may help someone else with a similar problem.

  • by Steve Hokenson,

    Steve Hokenson Steve Hokenson Dec 4, 2013 11:38 AM in response to andyBall_uk
    Level 1 (11 points)
    Dec 4, 2013 11:38 AM in response to andyBall_uk

    This also worked for me:

    andyBall_uk wrote:

     

    Quit Safari, Open Terminal (/Applications/Utilities) & copy/paste the following line, then press enter.

     

    defaults delete -app Safari WebKitOmitPDFSupport

    Adobe Reader is a pain, and unnecessary. Do yourself and remove from your Applications folder.

  • by dookuslide,

    dookuslide dookuslide Dec 10, 2013 4:16 PM in response to andyBall_uk
    Level 1 (0 points)
    Dec 10, 2013 4:16 PM in response to andyBall_uk

    This also solved my same issue. I couldn't find the answer elsewhere. It is plain crazy.

     

     

    andyBall_uk wrote:

     

    Quit Safari, Open Terminal (/Applications/Utilities) & copy/paste the following line, then press enter.

     

    defaults delete -app Safari WebKitOmitPDFSupport

     

    Don't install Adobe Reader's plug-ins unless you need them for the relatively few pdf's that won't display in Safari or Preview.

     

    WebKitOmitPDFSupport used to make Safari download pdf files rather than try to display them - the latest version doesn't handle that & displays them anyway, but as raw data.