Thursday, 28 July 2011

Adding PDF Files to the Sharepoint Foundation 2010 Search

There's quite a bit of misleading info on the web regarding this so I'm putting this here to try clear it up a bit
From this and this

1. Install PDF iFilter 9.0 (64 bit) from

2. Download PDF icon picture from Adobe web site and copy to [i]C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\[/i]

3. Add the following entry in docIcon.xml file under File types, which can be found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML

<Mapping Key="pdf" Value="pdf16.gif" />

4. Copy the below content to a VBS file and save it (I.E save file name as AddExtension.vbs) in the C:\ drive of the server
Sub Usage

    WScript.Echo "Usage:    AddExtension.vbs extension"

end Sub

Sub Main

    if WScript.Arguments.Count < 1 then
   end if

    dim extension
    extension = wscript.arguments(0)

    Set gadmin = WScript.CreateObject("SPSearch4.GatherMgr.1", "")

    For Each application in gadmin.GatherApplications
        For Each project in application.GatherProjects

End Sub

call Main 

5. Now run the following from Command Prompt:

WScript AddExtension.vbs pdf 

6. Register PDF ifilter as below:

   Find regkey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\"
   Right-Click – [New]-[Key]. Then specify key name ".pdf"
    Right-Click (Default) of above ".pdf" key then click "Modify"
    Specify value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
    Restart SPSearch4

7. stsadm.exe -o spsearch action startfullcrawl

If step 7 fails due to a crawl being in progress:
stsadm.exe -o spsearch action stopfullcrawl

Your Sharepoint Foundation server will now start indexing the content of Text-PDFs