http://support.microsoft.com/kb/2293357
- Install PDF iFilter 9.0 (64 bit) from http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
- Download PDF icon picture from Adobe web site http://www.adobe.com/misc/linking.html and copy to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\
- Add the following entry in docIcon.xml file, which can be found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
- Add pdf file type on the File Type page under Search Service Application
- Open regedit
- Navigate to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension - Right-click > Click New > Key to create a new key for .pdf
- Add the following GUID in the default value
{E8978DA6-047F-4E3D-9C78-CDBE46041603}
- Restart the SharePoint Server Search 14
- Reboot the SharePoint servers in Farm
- Create a Test site (with any out-of-box site template) and create a document library upload any sample PDF document(s).
- Perform FULL Crawl to get search result.
SharePoint 2010 Foundation
http://support.microsoft.com/kb/2518465
1. Copy the below content to a VBS file and save it (I.E save file name as AddExtension.vbs)
-----------------
Sub Usage
WScript.Echo "Usage: AddExtension.vbs extension"
WScript.Echo
end Sub
Sub Main
if WScript.Arguments.Count < 1 then
Usage
wscript.Quit(1)
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
project.Gather.Extensions.Add(extension)
Next
Next
End Sub
call Main
-----------------------
2. Copy the above script file to Sharepoint Foundation 2010 Server
3. Run it from Command Prompt
> WScript AddExtension.vbs pdf
4. Register PDF ifilter as below:
4-1. Find regkey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\"
4-2. Right-Click – [New]-[Key]. Then specify key name ".pdf"
4-3. Right-Click (Default) of above ".pdf" key then click "Modify"
4-5. Specify value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
4-6. Restart SPSearch4
5. Run crawl as below
>stsadm –o spsearch –action fullcrawlstart
6. Confirm the pdf files can be found in search results
PowerShell Configuration
http://www.sharepointusecases.com/index.php/2011/02/automate-pdf-configuration-for-sharepoint-2010-via-powershell/
Here is what you need to do:
- Download and install the Adobe PDF iFilter
- Configure SharePoint Foundation search service via Central Admin (or PowerShell)
- Download the Adobe PDF icon (select Small 17 x 17) and save it to a folder on your SharePoint server as pdficon_small.gif
- Download the script below and place it to the same folder as Adobe PDF Icon
- Run the script as administrator from Powershell shell
function Get-FileFormatDate {
param( [DateTime]$Date = [DateTime]::now )
return $Date.ToUniversalTime().toString( "yyyy-MM-dd_hh-mm-ss" )
}
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
$continue = Read-Host "This script will change SharePoint configuration files, registry and will restart your IIS! Would you like to continue (Y/N)"
if($continue -eq "Y")
{
Write-Host -ForegroundColor Yellow "Configuring PDF Icon..."
$SharePointRoot = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14";
$DocIconFolderPath = "$SharePointRoot\TEMPLATE\XML";
$DocIconFilePath = "$DocIconFolderPath\docicon.xml";
Write-Host "Creating backup of DocIcon.xml file..."
$dateNow = Get-FileFormatDate
$backupFile = "$DocIconFolderPath\Backup_DocIcon_" + $dateNow + ".xml"
Copy-Item $DocIconFilePath $backupFile
$pdfIcon = "pdficon_small.gif";
while((Get-Item $pdfIcon) -eq $null)
{
Read-Host "$pdfIcon is missing. Download it from http://www.adobe.com/misc/linking.html and place it to this folder. Press any key to continue...";
}
Copy-Item $pdfIcon "$SharePointRoot\Template\Images";
$pdfNode = select-xml -path $DocIconFilePath -xpath "/DocIcons/ByExtension/Mapping[@Key='pdf']" | select-object -expandProperty Node
if($pdfNode -eq $null)
{
$xml= [xml] (Get-Content $DocIconFilePath)
$a = $xml.selectSingleNode("/DocIcons/ByExtension")
$addnode = $xml.createElement("Mapping")
$a.AppendChild($addNode)
$keyAttribute = $xml.CreateAttribute("Key")
$keyAttribute.set_Value("pdf")
$addNode.SetAttributeNode($keyAttribute)
$valueAttribute = $xml.CreateAttribute("Value")
$valueAttribute.set_Value("pdficon_small.gif")
$addNode.SetAttributeNode($valueAttribute)
$xml.Save($DocIconFilePath)
}
Write-Host -ForegroundColor Yellow "Configuring search crawl extension..."
$searchServiceApp = Read-Host "Type the name of your search service application (e.g. Search Service Application)"
$searchApplicationName = Get-SPEnterpriseSearchServiceApplication $searchServiceApp
if($searchApplicationName -ne $null)
{
if(($searchApplicationName | Get-SPEnterpriseSearchCrawlExtension "pdf") -eq $null)
{
$searchApplicationName | New-SPEnterpriseSearchCrawlExtension "pdf"
}
}
Write-Host -ForegroundColor Yellow "Updating registry..."
if((Get-Item -Path Registry::"HKLM\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf") -eq $null)
{
$item = New-Item -Path Registry::"HKLM\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf"
$item | New-ItemProperty -Name Extension -PropertyType String -Value "pdf"
$item | New-ItemProperty -Name FileTypeBucket -PropertyType DWord -Value 1
$item | New-ItemProperty -Name MimeTypes -PropertyType String -Value "application/pdf"
}
if((Get-Item -Path Registry::"HKLM\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf") -eq $null)
{
$registryItem = New-Item -Path Registry::"HKLM\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf";
$registryItem | New-ItemProperty -Name "(default)" -PropertyType String -Value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
}
[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin", "Machine")
Write-Host -ForegroundColor Yellow "Restarting SharePoint Foundation Search Service..."
Restart-Service SPSearch4
Write-Host -ForegroundColor Yellow "Restarting SharePoint Search Service..."
Restart-Service OSearch14
Write-Host -ForegroundColor Yellow "Restarting IIS..."
iisreset
Write-Host -ForegroundColor Green "Installation completed..."
}
No comments:
Post a Comment