PDFlib TET PDF IFilter 4.0 Manual
PDFlib TET PDF IFilter 4.0 Manual
PDFlib TET PDF IFilter 4.0 Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
SQL queries for metadata properties. SQL queries can search for predefined as well as<br />
custom properties. Some examples are provided below; they assume that indexing of<br />
all predefined properties has been enabled in the XML configuration file, and that the<br />
predefined_properties.propdesc property description has been registered. We use ADO<br />
(ActiveX Data Objects) and PowerShell scripts to submit SQL-based queries. However, you<br />
can use the SQL statements in any other ADO or ADO.NET environment as well. A description<br />
of the SQL syntax extensions for Windows search is available at<br />
msdn.microsoft.com/en-us/library/bb231256(VS.85).aspx<br />
Property searches can be applied in two directions:<br />
> Query a specific property value: which documents have Doyle as author?<br />
> Query the value of a specific property in one or more files: who is the author of this<br />
document?<br />
PowerShell for submitting SQL queries. Windows PowerShell is included in Windows 7<br />
and Windows Server 2008, and can be installed on Windows XP SP2, Windows Server<br />
2003, and Windows Vista. The installation files can be downloaded from the following<br />
location:<br />
www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx<br />
Sample PowerShell query scripts are installed with <strong>TET</strong> <strong>PDF</strong> <strong>IFilter</strong>. The following Power-<br />
Shell script lists all bookmarks for all documents:<br />
$objConnection = New-Object -comobject ADODB.Connection<br />
$objRecordset = New-Object -comobject ADODB.Recordset<br />
$objConnection.Open("Provider=Search.CollatorDSO;Extended<br />
Properties='Application=Windows';")<br />
$objRecordSet.Open(<br />
"SELECT System.ItemPathDisplay, `"<strong><strong>PDF</strong>lib</strong>.<strong>TET</strong><strong>PDF</strong><strong>IFilter</strong>.bookmark`" FROM SYSTEMINDEX ",<br />
$objConnection)<br />
While ($objRecordset.EOF -ne $True) {<br />
$private:item = $objRecordset.Fields.Item("System.ItemPathDisplay")<br />
Write-Output $item.Value<br />
$item = $objRecordset.Fields.Item("<strong><strong>PDF</strong>lib</strong>.<strong>TET</strong><strong>PDF</strong><strong>IFilter</strong>.bookmark")<br />
Write-Output $item.Value<br />
$objRecordset.MoveNext()<br />
}<br />
The following PowerShell script lists all documents where at least one bookmark contains<br />
the text alpha:<br />
$objConnection = New-Object -comobject ADODB.Connection<br />
$objRecordset = New-Object -comobject ADODB.Recordset<br />
$objConnection.Open("Provider=Search.CollatorDSO;Extended<br />
Properties='Application=Windows';")<br />
$objRecordSet.Open("SELECT System.ItemPathDisplay FROM SYSTEMINDEX WHERE " +<br />
"`"<strong><strong>PDF</strong>lib</strong>.<strong>TET</strong><strong>PDF</strong><strong>IFilter</strong>.bookmark`" = SOME ARRAY ['alpha']", $objConnection)<br />
While ($objRecordset.EOF -ne $True) {<br />
$private:item = $objRecordset.Fields.Item("System.ItemPathDisplay")<br />
Write-Output $item.Value<br />
50 Chapter 3: Metadata Properties