Member Avatar for Member #44883

I have a bunch of PDF files made from documents scanned into jpeg images. Now, how can i search these pdf documents for text that is in the image.

:!: This does not seem possible to me as well but i'll appreciate any sort of methods. Any modifications that may need to be done to the images before converting them to pdf?? Anything else?

Thanks a lot

Dani AI

Generated

The PDFs in this thread are scans (images only), so keyword searching requires extracting text from those images rather than relying on any embedded text layer. correctly pointed toward OCR; ’s note about creating PDFs differently is also relevant if rescanning is an option. ’s idea of a manual index will work but is slow at scale.

A practical, repeatable pipeline that avoids purely manual tagging:

  • Produce lossless, high-resolution page images (300–400 DPI) from the PDFs.
  • Preprocess to improve OCR: deskew, despeckle, increase contrast and binarize (tools like ImageMagick or unpaper are commonly used).
  • Run OCR that can write a searchable PDF or hOCR with bounding boxes (examples: Tesseract or the ocrmypdf wrapper).
  • Index the resulting plain text or OCR layer in a full-text engine (Lucene/Elasticsearch, Solr, or SQLite FTS) for fast keyword search.

Relevant tools and formats: Tesseract (OCR engine) and OCRmyPDF (adds OCR layers to PDFs and automates many preprocessing steps) are practical starting points. hOCR output preserves word bounding boxes and confidence scores that help downstream heuristics for headline detection.

For headline extraction and quality control, combine heuristics and a light verification pass: identify candidate headline lines by large bounding-box height, short line length, and top-of-page placement; prioritize low-confidence OCR results for human review; store confirmed headlines in a small database for fast lookup. Multi-column layouts, heavy JPEG compression, or historical fonts often require extra cleanup or specialized engines (e.g., Kraken) and will reduce OCR accuracy, so plan for a hybrid automated+human workflow rather than pure manual indexing.

Recommended Answers

All 6 Replies

It isn't. There is no text in an image. It's just part of the image.

You can try an OCR (optical character reader) program that can read an image (non-compressed, usually). The best one I found is from

Member Avatar for Member #44883

It isn't. There is no text in an image. It's just part of the image.

You can try an OCR (optical character reader) program that can read an image (non-compressed, usually). The best one I found is from

Thanks...

Actually I am trying to write a program that'll search the pdfs for keywords. I guess i'll have to associate files with the keywords in the image then. I can think of only this method... Is this the only wayt to do that?

Thanks..

he's already told you to create your PDF files differently...

Thanks...

Actually I am trying to write a program that'll search the pdfs for keywords. I guess i'll have to associate files with the keywords in the image then. I can think of only this method... Is this the only wayt to do that?

Thanks..

I really have no idea how you plan to "associate files with the keywords in the image" unless you mean connecting text file to an image somehow. Maybe you need to explain in detail what you are trying to accomplish, what type of images (bitmaps, jpg, etc)

Member Avatar for Member #44883

I have a bunch of images that are a result of scanned newspapers. I need to link the headlines in the newspaper's image to an index. SO, what i was thinking was making a data base to link the image file with keywords of the headlines. I think this is the only way to do that.

That makes sense. The only way to do that as far as I know is by hand. As I said, there is no text in an image so you will have to eyeball the headlines and type them in. Even an OCR program won't help that much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.