I want to insert invisible text into an existing PDF file, to make it searchable.

For instance, if the user searches for "hello", the PDF reader should send the user to the page where I embedded that text, even though it is not visible.

What Java library should I use?
I would appreciate links to specific API methods to use.

Gratis, ideally open source.

(For the curious: I want to automatically OCR incoming scanned papers and make them searchable, in an Alfresco repository, while still making only the original image visible, with the sometimes-faulty OCR result present on the same page yet invisible)

  • Would it be acceptable to store the "invisible" text in the metadata? Many document management systems will index the metadata of documents, and it would not interfere with screen readers. It would, however, be visible to a user deliberately looking at the metadata in a PDF reader (or text editor). – Andrew Morton Jan 2 at 18:36
  • @AndrewMorton: That's an idea, but it would not show the right page of the document, right? Or would it? – Nicolas Raoul Jan 3 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.