• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

PDF search with javascript, perhaps nodejs?  RSS feed

 
Ranch Hand
Posts: 234
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI guys, is it possible to build an application that searches through pdfs in javascript? I was playing around a little with "Javascript for Acrobat" which I seem to understand it's some kind of subset of javascript and using the adobe reader console I put together a few lines of code that search through a collection of pdfs (providing they are saved in the same folder). My reference was this in case you wonder http://help.adobe.com/livedocs/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm.



This snippet, when run in the adobe reader console, does actually search the PDF documents in the specified folder (PDFs) and find any occurrence of the word "will".
I'd like to turn this into a proper application, nothing fancy, the functionality is enough for now (although I might add something else to it), do you guys have a rough idea on how to go about that? I thought perhaps nodejs might be the way forward
cheers
 
Jason Attin
Ranch Hand
Posts: 234
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to add to this, what I am really looking for is to be able to do this externally, without using the adobe acrobat reader console, perhaps using a PDF API and being able to return a Json object containing the results
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haven't used it myself, but there is a library for working with PDFs using JavaScript called Pdf.js (https://github.com/mozilla/pdf.js).
While it doesn't do searches itself, it could be used together with a full text search engine to achieve what you're describing. This blog post describes this kind of solution:
https://www.garysieling.com/blog/building-a-full-text-index-in-javascript.

Hope this helps!
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!