So you want to parse a PDF?
eliot-jones.com
So you want to parse a PDF?
1–10 of 236 posts
Re: So you want to parse a PDF?
#2Having said that, I believe there are "streamable" PDF's where there is enough info up front to render the first page (but only the first page).
(But I have been out of the PDF loop for over a decade now so keep that in mind.)
Re: So you want to parse a PDF?
#3Absolutely not. For the reasons in the article.
Re: So you want to parse a PDF?
#4Yeah, PDF didn't anticipate streaming. That pesky trailer dictionary at the end means you have to wait for the file to fully load to parse it. Having said that, I believe there are "streamable" PDF's where there is enough info up front to render the first page (but only the first page). (But I have been out of the PDF loop for over a decade now so keep that in mind.)
Re: So you want to parse a PDF?
#5Re: So you want to parse a PDF?
#6Some vision LLMs can accept PDF inputs directly too, but you need to check that they're going to convert to images and process those rather than attempting and failing to extract the text some other way. I think OpenAI, Anthropic and Gemini all do the images-version of this now, thankfully.
Re: So you want to parse a PDF?
#7Re: So you want to parse a PDF?
#8Re: So you want to parse a PDF?
#9I convert the PDF into an image per page, then dump those images into either an OCR program (if the PDF is a single column) or a vision-LLM (for double columns or more complex layouts). Some vision LLMs can accept PDF inputs directly too, but you need to check that they're going to convert to images and process those rather than attempting and failing to extract the text some other way. I think OpenAI, Anthropic and…