# Models for reading Schematic PDF's

**URL:** <https://discuss.huggingface.co/t/models-for-reading-schematic-pdfs/137606>\
**Category:** Models\
**Created:** [January 27, 2025, 8:12pm UTC](https://discuss.huggingface.co/t/models-for-reading-schematic-pdfs/137606 "2025-01-27T20:12:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrackliffe](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jrackliffe](https://discuss.huggingface.co/u/jrackliffe)\
**Post date:** [January 27, 2025, 8:12pm UTC](https://discuss.huggingface.co/t/models-for-reading-schematic-pdfs/137606/1 "2025-01-27T20:12:05Z")

</div>

Hello All!

I am working with some very complex PDF files that contain CAD’s and Multi Directional Text on the same pages, like the attached pic

 ![example](https://us1.discourse-cdn.com/hellohellohello/original/3X/c/6/c60d121d1c8e2bedbef06d72cd59cc550032f71d.png)

I have tried a few py scripts in BERT and Layout and had no luck… Anyone have any suggestions on how I can get this information out of this crap and into a Model so we can learn from it and then automate pieces in Excel and such?

Thanks much!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [January 28, 2025, 3:16pm UTC](https://discuss.huggingface.co/t/models-for-reading-schematic-pdfs/137606/2 "2025-01-28T15:16:51Z")

</div>

I wonder if this is suitable for relatively messy PDFs with existing software.  
But even this might not be enough…  
[https://pypi.org/project/pymupdf4llm/](https://pypi.org/project/pymupdf4llm/)

---

<div class="post-metadata">

**Author:** ![Alanturner2](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alanturner2/32/37542_2.png) [@Alanturner2](https://discuss.huggingface.co/u/Alanturner2)\
**Post date:** [January 28, 2025, 3:53pm UTC](https://discuss.huggingface.co/t/models-for-reading-schematic-pdfs/137606/3 "2025-01-28T15:53:50Z")

</div>

How about using OCR?  
You can get text using simple code.

```auto
pip install pytesseract pillow pdf2image

```

And the run this code

```auto
from pdf2image import convert_from_path
from PIL import Image
import pytesseract

# Path to the PDF
pdf_path = "your_file.pdf"

# Convert PDF pages to images
images = convert_from_path(pdf_path)

# Perform OCR on each page
for i, image in enumerate(images):
    # Extract text from the image
    text = pytesseract.image_to_string(image)
    print(f"Text from page {i + 1}:\n{text}\n")

```

Hope this help!
