Changeset 13291


Ignore:
Timestamp:
2006-11-17T10:46:29+13:00 (17 years ago)
Author:
lh92
Message:

add in the formatting_word_pdf exercise of how to pass the search terms to Acrobat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl-documentation/tutorials/xml-source/tutorial_en.xml

    r13265 r13291  
    10531053</Format>
    10541054</NumberedItem>
     1055<Heading>
     1056<Text id="fw-24">Opening PDF files with query terms highlighted</Text>
     1057</Heading>
     1058<NumberedItem>
     1059<Text id="fw-24a">Next we'll customize the <AutoText text="SearchVList"/> format statement to highlight the query terms in a PDF file when it is opened from the search result list. This requires Acrobat Reader 7.0 version or higher, and only works on a windows platform.</Text>
     1060</NumberedItem>
     1061<NumberedItem>
     1062<Text id="fw-24c">The search terms are kept in the macro variable <AutoText text="_cgiargq_"/>, and we can append <AutoText text="#search=&quot;_cgiargq_&quot;"/> to the end of a PDF file link to pass the query terms to the PDF file.</Text>
     1063<Text id="fw-24d">By default, each PDF file is renamed as <AutoText text="doc.pdf"/> and saved in a unique hash directory when processed by <AutoText text="PDFPlug"/>, so we use</Text>
     1064<Format>_httpcollection_/index/assoc/[archivedir]/doc.pdf</Format>
     1065<Text id="fw-24e">to locate the PDF source file in a search result list.<br/>If you used the <AutoText text="-keep_original_filename"/> option of the <AutoText text="PDFPlug"/> to build the collection, then the original name of the PDF file is kept, and we use</Text>
     1066<Format>_httpcollection_/index/assoc/[archivedir]/[Source]</Format>
     1067<Text id="fw-24f">instead to locate a PDF source file.</Text>
     1068</NumberedItem>
     1069<NumberedItem>
     1070<Text id="fw-24g">Select <AutoText text="SearchVList"/> from the list of assigned formats. We first judge whether a file in the search result list is a PDF file, we can use</Text>
     1071<Format>[ex.FileFormat] eq 'PDF'</Format>
     1072<Text id="fw-24h">in an <Format>{If}</Format> statement to do this. Then we use the above format instead of the <AutoText text="[ex.srclink]"/> and <AutoText text="[ex./srclink]"/> variables just for the PDF files.</Text>
     1073<Text id="fw-24b">The resulting format statement looks like:</Text>
     1074<Format>
     1075&lt;td valign="top"&gt;[link][icon][/link]&lt;/td&gt;<br/>
     1076&lt;td valign="top"&gt;<highlight>{If}{[ex.FileFormat] eq 'PDF', &lt;a
     1077href=\\"_httpcollection_/index/assoc/[archivedir]/doc.pdf#search=&amp;quot;_cgiargq_&amp;quot;\"&gt;[ex.srcicon]&lt;/a&gt;,<br/>[ex.srclink][ex.srcicon][ex./srclink]}</highlight>&lt;/td&gt;<br/>
     1078&lt;td valign="top"&gt;[highlight]<br/>
     1079{Or}{[dc.Title],[ex.Title],Untitled}<br/>
     1080[/highlight]{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}&lt;/td&gt;<br/>
     1081</Format>
     1082<Text id="fw-24i">When the PDF icons are clicked in the search results, Acrobat will open the file with the search window opened, and the query terms highlighted.</Text>
     1083</NumberedItem>
    10551084</Content>
    10561085</Tutorial>
Note: See TracChangeset for help on using the changeset viewer.