frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Everything that happens in a US airport is under duress

7•dfps•2h ago•6 comments

Ask HN: What's the Point of Your Startup?

4•sawyers•2h ago•6 comments

The Mistake That Cost Me a Year

4•wyrior•2h ago•0 comments

Ask HN: When a post of yours does well, do you know why?

2•john_builds•2h ago•2 comments

Ask HN: What E-Reader to Buy?

4•conor_f•4h ago•5 comments

Strategic Oil Reserves Down to a Record Low Two-Week Supply

15•megamike•16h ago•9 comments

Ask HN: What are some promising fields in computer science in the next 5 yrs?

3•anonymoosestdnt•2h ago•2 comments

Ask HN: What are you using for LLM inference in production?

6•chrislim•8h ago•4 comments

Ask HN: Can Apple Ever Be Disrputed?

5•Taikhoom2010•14h ago•16 comments

Ask HN: What former "must-have" AI agent skills have you deprecated?

5•lpjstack•19h ago•0 comments

Robotics development made dead simple (open source)

22•Ekami•5d ago•7 comments

Ask HN: After 8 Years of Failed Apps, Should I Give Up?

6•asoomi07•16h ago•11 comments

Stripe's opt-out Radar price increase dressed up as a free trial

9•rapind•23h ago•1 comments

I built an independent peptide testing lab that accepts mailed samples

6•peptidelabs•23h ago•0 comments

Can LLMs have an "accent" like second language speakers?

3•hmokiguess•17h ago•4 comments

Ask HN: Do older programmers/CS academics view AI safety as a form of arrogance?

5•amichail•1d ago•12 comments

Ask HN: Navigating Source Code (especially on large projects)

5•thekey•1d ago•3 comments

Ask HN: Should authors disclose if they are paid to write a blog post?

5•wseqyrku•1d ago•5 comments

YC startup offers interviews to people who get their name permanently tattooed

18•codexon•1d ago•13 comments

Ask HN: Crooked Timber showed showed me a virus captcha, What now?

43•Jgoauh•3d ago•47 comments

Tell HN: Airbnb updated "necessary" cookies aren't

8•janalsncm•1d ago•0 comments

Belkin killed my smart switch. I got it working again without their app

13•gaborme•2d ago•2 comments

Ask HN: Has Claude Code been (mostly) usable for you?

1•mark_l_watson•37m ago•2 comments

You've reached the end!

Open in hackernews

Ask HN: Best on device LLM tooling for PDFs?

4•martinald•1y ago
I've got very used to using the "big" LLMs for analysing PDFs

Now llama.cpp has vision support; I tried out PDFs with it locally (via LM Studio) but the results weren't as good as I hoped for. One time it insisted it couldn't do "OCR", but gave me an example of what the data _could_ look like - which was the data.

The other major problem is sometimes PDFs are actually made up of images; and it got super confused on those as well.

Given this is so new I'm struggling to find any tools which make this easier.

Comments

raymond_goo•1y ago
Try something like this

  !pip install pytesseract pdf2image pillow
  !apt install poppler-utils
  #!apt install tesseract-ocr
  from pdf2image import convert_from_path
  import pytesseract

  pages = convert_from_path('k.pdf', dpi=300)

  all_text = ""
  for page_num, img in enumerate(pages, start=1):
      text = pytesseract.image_to_string(img)
      all_text += f"\n--- Page {page_num} ---\n{text}"

  print(all_text)
constantinum•1y ago
give https://pg.llmwhisperer.unstract.com/ a try