Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Seeking Advice on Improving OCR for Watermarked PDFs in My RAG Pipeline
3 points by hundredtrillion 8 months ago | hide | past | favorite | 3 comments
I’ve been developing a small RAG pipeline and ran into a specific technical issue involving OCR. I’m using PyMuPDF for extraction, and whenever a PDF contains a centered watermark on each page, the OCR becomes noisy—text breaks, artifacts show up, and the output degrades enough that it affects chunking and retrieval accuracy downstream.

The document is otherwise clean, so I’m trying to understand whether this is a known limitation of PyMuPDF or if there are better approaches for handling watermarked PDFs before OCR. I’m working with an RTX 4000 (8GB VRAM), so I’m also trying to stay within reasonable GPU constraints.

I’d really appreciate any ideas on:

more robust OCR libraries or models that handle watermarks well

preprocessing strategies to suppress watermark text

better extraction pipelines for RAG use cases

or any general advice on improving this part of the system

The project is open-source, and if anyone is interested in digging deeper, finding issues, or contributing improvements, here’s the repository:

GitHub: https://github.com/Hundred-Trillion/L88-Full

If you find it useful, starring the repo helps increase visibility so more people with domain expertise might notice it.

Thanks in advance for any insights.



I've had a lot of success doing "OCR" with gemini-<n>-pro. It gives incredibly accurate text (Most documents ~20 pages long have 0 errors), but no coordinates of the text. I don't need to coordinates so that's fine by me.


I think LLMWhisperer might help you here https://pg.llmwhisperer.unstract.com/


For watermarked PDFs in RAG, standard OCR often fails. The key in 2026 is moving toward Multi-modal LLMs that can perform layout-aware extraction instead of raw text scraping. By treating the document as a visual entity first, you bypass the noise of the watermark. I’ve explored how these RAG-optimized architectures are becoming a core part of modern full-stack development, and it’s definitely the direction the industry is heading to solve these specific preprocessing bottlenecks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: