| 1 |
<!-- |
| 2 |
! Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 |
! contributor license agreements. See the NOTICE file distributed with |
| 4 |
! this work for additional information regarding copyright ownership. |
| 5 |
! The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 |
! (the "License"); you may not use this file except in compliance with |
| 7 |
! the License. You may obtain a copy of the License at |
| 8 |
! |
| 9 |
! http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
! |
| 11 |
! Unless required by applicable law or agreed to in writing, software |
| 12 |
! distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
! See the License for the specific language governing permissions and |
| 15 |
! limitations under the License. |
| 16 |
!--> |
| 17 |
<html> |
| 18 |
<head> |
| 19 |
<title>PDFBox Examples</title> |
| 20 |
|
| 21 |
<script language="JavaScript"> |
| 22 |
|
| 23 |
function forwardToPDF() |
| 24 |
{ |
| 25 |
var xmlURL = "" + window.location; |
| 26 |
if( xmlURL.lastIndexOf( "index.html" ) > 0 ) |
| 27 |
{ |
| 28 |
xmlURL = xmlURL.substring( 0, xmlURL.lastIndexOf( "index.html" ) ); |
| 29 |
} |
| 30 |
if( xmlURL.charAt( xmlURL.length-1 ) != '/' ) |
| 31 |
{ |
| 32 |
xmlURL += "/"; |
| 33 |
} |
| 34 |
xmlURL += "highlight.jsp"; |
| 35 |
var finalURL = window.document.highlightForm.pdfURL.value + |
| 36 |
"#xml=" + xmlURL + |
| 37 |
"?pdf=" + window.document.highlightForm.pdfURL.value + |
| 38 |
"&words=" + window.document.highlightForm.highlightWords.value; |
| 39 |
|
| 40 |
window.location = finalURL; |
| 41 |
} |
| 42 |
|
| 43 |
</script> |
| 44 |
|
| 45 |
</head> |
| 46 |
<body> |
| 47 |
|
| 48 |
<h1>PDFBox Highlighter example</h1> |
| 49 |
|
| 50 |
This is a simple example to show off the PDFBox highlighting capabilities. Enter a URL PDF that you would like to view and |
| 51 |
some words that you would like to search on. <br /> <br /> |
| 52 |
|
| 53 |
See the <a href="http://partners.adobe.com/public/developer/en/pdf/HighlightFileFormat.pdf">PDF Highlighter spec</a> for more detailed information. |
| 54 |
|
| 55 |
<form name="highlightForm" method="GET" action=""> |
| 56 |
PDF: <input name="pdfURL" type="text" size="100" value="http://www.csh.rit.edu/~ben/projects/pdfbox/userguide/bookmarks.pdf" /><br /> |
| 57 |
Highligh words:<input type="text" name="highlightWords" length="100" value="hierarchical" /><br /><br /> |
| 58 |
<input type="button" value="View PDF With Highlighting" onClick="forwardToPDF()"/> |
| 59 |
</form> |
| 60 |
|
| 61 |
|
| 62 |
</body> |
| 63 |
</html> |