Im asks
Im asks

Reputation: 21

Highlighting text on PDF page using JQuery?

I wonder to know how can we hightlight text and make annotations using JQuery ? If this feature not available with JQuery , Is there possibility to make it with JavaScript ?

Upvotes: 1

Views: 4173

Answers (3)

mirosz
mirosz

Reputation: 417

I had similar problem and my solution for now is to use Kineticjs to draw on a PDF ( highlights it's just a transparent rectangle ). Then I'm packing everything (all drawing) into Json string and sending it to the server where I'm using PDFsharp to process and save.

Upvotes: 0

paulsm4
paulsm4

Reputation: 121881

Actually, Acrobat reader has a fairly robust API for manipulating .pdf documents ...

... and that API happens to be in Javascript.

Here are a couple of links:

http://www.adobe.com/devnet/acrobat/javascript.html

http://asserttrue.blogspot.com/2010/07/workaround-for-acrobat-javascripts-lack.html

http://www.evermap.com/javascript.asp

Whether any of this will work in your particular scenario is anybody's guess.

'Hope that helps...

Upvotes: 2

riwalk
riwalk

Reputation: 14233

It can't be done. JavaScript runs on HTML pages and manipulates the DOM.

PDF files are transferred as binary and are viewed using a PDF viewer plugin. Javascript is nowhere in the process.

Upvotes: 1

Related Questions