How can I create a searchable PDF file using individual PNG images?

I currently have a series of images (PNG) and, for each, an unformatted text version of their contents. I would like to create a PDF file where each image will become a full page of the resulting PDF file, and the corresponding text will also be attached to the page, so searching for some words will lead you to pages with this text on it, although the text is never displayed directly.

This is a one-time job, so it should not be neat or scalable. I could use any language commonly available on a Linux system, or the usual command line tools. (I also have a Windows system with Acrobat available, although there are about a thousand images, so something manually will not work.)

+5
source share
1 answer

One option is to create a PDF file using Java and Apache-Fop , but this may be more work than you want.

You can do better with iText; An example of adding PNG to iText to create a PDF

You will need to determine how to create Layerin which you can place text that is searchable; I cannot tell you how to do this.

It describes how PDF can contain text that can help you create it.

+1
source

All Articles