Click here to Skip to main content
15,906,628 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi Guys,

I have a .pdfs file (searchable pdf) you can also consider .pdf file. I need to go to a word index within a given page (i will get page number and start index of the word and end index of word from database) and highlight the word. Please guide me or give me code in webform that allow's me to highlight word in a pdf given is page number and word start index and end index.

Please help me for the same.
Thankyou in advance.
Posted
Comments
Have you tried anything yet? CodeProject is a place for those who code.
Vandana87 15-Jun-15 5:56am    
hi, i have provided the code plz giude me if you can..
thankyou
Vandana87 9-Jun-15 2:04am    
Obviouly i have tried many things and didnt got proper answer, thats why i am here. Below code jumps to the page number when i click on page number in the div. From the below code to can try to get page number from Database and jump on the apprppriate page..

<div>

<div width="50%" id="dvPdf">
<iframe src="http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#page=5&zoom=auto,-169,394" width="500" height="500"></iframe>

</div><div style="float:right">(note DIC adds the space in java script below:)
1
20
30
61
</div>
<script type="text/javascript">
function scrollPdf(v) {
document.getElementById("dvPdf").innerHTML = '<iframe src="http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#page=5&zoom=auto,-169,394#page=' + v + '" width="500" height="500"></iframe>';

}
</script>

</div>


Now the challange is how to get the word index after jumping to page.

Before this javascript technique i have also tried making a pdf file using itextshare and highlighting text with hardcode coordinate value. Also getting page number dynamically using below code.

Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
process.StartInfo = startInfo;
// startInfo.UseShellExecute = false;
startInfo.Arguments = "/A \"page=20\"";
startInfo.FileName = @"C:\\Users\\123\\Desktop\\PDF HIGHLIGHT\\03june\\sample.PDFS\";
process.Start();

// Process.Start(startInfo);

I hope i have done somethning sensible. Please guide me if theres something wrong.

Thankyou

1 solution

 
Share this answer
 
Comments
Vandana87 16-Jun-15 9:35am    
hey, have already tried all this..Let me tell you what is actually want..

I have PDFS file in which I want to jump to a chunk(string) location based on the chunk(string) count. For example, in PDFS file I have around 100 chunks(strings) on page 5 and I want to jump to 53rd chunk(string) of the this page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900