frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Debatable but likely not insane: there MAY be an issue with SpaceX' hiring

2•adinhitlore•31m ago•0 comments

Ask HN: Failing interviews for mid-level SWE in UK, advice please

10•mjb8086•4h ago•5 comments

Ask HN: Is HN Blocking Mullvad VPN?

3•burger_moon•4h ago•2 comments

Ask HN: Anyone else struggling with AI and work?

7•carlgreene•4h ago•4 comments

Valgrind-3.27.1 Is Available

7•paulf38•9h ago•1 comments

Ask HN: Shouldn't Google need to give a public statement about Railway incident?

173•srameshc•1d ago•102 comments

Ask HN: What are you working on? (May 21)

7•Armonsrer•9h ago•38 comments

Ask HN: Are there any serious efforts to organize tech labor now?

27•0rganize•1d ago•23 comments

Alternatives to HN for "tech outside of AI" discussion?

54•summonerOS•1d ago•35 comments

Tell HN: Google banned Railway's account. Everything down

30•sergiotapia•1d ago•18 comments

Can one run AI on source code with the prompt "Find below-avg swear rate files"?

3•pcwir•22h ago•2 comments

Ask HN: How does everyone talk about their work when they've used AI?

5•deku2099•1d ago•9 comments

Ask HN: How to manage AI APIs for SaaS application?

4•sbinnee•1d ago•5 comments

Ask HN: Suggest Google Antigravity Alternative

6•Pallavimdb•1d ago•10 comments

Do you enjoy reading any type of AI written text?

4•reed1234•14h ago•10 comments

Ask HN: How to make a mono-repo AI-Ready?

2•kasnaka•1d ago•4 comments

Ask HN: Sorry, what Was FiveThirtyEight?

9•gagdiez•1d ago•5 comments

Ask HN: Does root have to be uid 0? Does uid 0 have to be root?

5•axismundi•2d ago•3 comments

Ask HN: What are Stainless users doing now that Anthropic has killed it?

5•ubutler•1d ago•3 comments

Did moving to new place have intended effect?

12•Jeff2Serve•2d ago•12 comments

Anthropic is killing stainless, so we built our own SDK/MCP generator

6•iiviie•1d ago•1 comments

Ask HN: Antigravity 2.0 installer breaks existing Antigravity IDEs

3•jdw64•2d ago•1 comments

Ask HN: Is grpcurl home page compromised?

4•jicea•2d ago•0 comments

Ask HN: How do word docs, slides, excel, and PDFs generate value?

6•FailMore•2d ago•9 comments

Ask HN: Go all in on startup idea, or stay W2

2•Mnexium•2d ago•35 comments

Ask HN: How often do you code the expected way instead of a better one?

4•recycling•2d ago•5 comments

Windows on Mobile Screen

3•tukunjil•2d ago•0 comments

Ask HN: Do you know what data your AI coding agent sends to the cloud?

5•lbrauer•3d ago•6 comments

Ask HN: How to enforce engineers to understand the code they are shipping

9•hchua•2d ago•21 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