Skip to main content
Participant
December 15, 2021
Question

Is using Adobe javascript a good solution for ....

  • December 15, 2021
  • 2 replies
  • 304 views

Given a  library of about 200 pdf documents that are informational only, text sections of these documents are to be stored in a database for tracking.  A plan is to use a web appliction to allow a user to select document sections in a browser , and store those sections in the database. 

 

The first idea was to use pdf  hilighting to select the text, capture the event, display a small menu and then use ajax / server code to save  the highlighted text in the database. 

 

Whats the best way to accomplish this?

What are potential problems?

 

 

 

 

 

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
December 16, 2021

If the Acrobat Preferences are setup for it, the highlight annotation and the Rectangle annotation will capture page text. So that part or your plan will work. But to actually move the text you'll need an event to trigger the code.  The easiest solution is to make an automation script triggered from a toolbar button. 

A more sophisticated solution is to write an automation tool that places a transparent button on every page of the document. Then use MouseUp/Down actions to capture mouse clicks to draw rectangles, capture text, and send it off to the server.

 

There isn't any Ajax for the Acrobat JavaScript model. There is however  an HTTP object that performs simple versions of all the HTTP ops. 

 

You can find out more about these operations here:

https://www.pdfscripting.com/public/Automating-Acrobat.cfm 

https://www.pdfscripting.com/public/HTTP-Access-Tester-Description.cfm

    

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
December 16, 2021

Thank you @Thom Parker.

This exact, concise  reply is exactly what I was looking for.

 

I persue an alternate implementation

try67
Community Expert
Community Expert
December 15, 2021

Highlighting a PDF file does not trigger any events I'm aware of, so you need to re-think your approach to this.