Re:Show HN: HTML visualization of a PDF file's internal stru...
by macklinkachorn on Monday February 10, 2025 @03:00PM
(#43004511)
In my previous role, I have experienced similar things where the rule-based parsing approach is really tricky to get right and often failed via from edge cases.
We (at https://runtrellis.com/) have been building PDF processing pipeline from the ground up with LLMs and VLMs and have seen close to 100% accuracy even for tricky PDFs. The key is to use rule based engine and references to cross check the data.
Re:Show HN: HTML visualization of a PDF file's internal stru...
by bob1029 on Monday February 10, 2025 @03:12PM
(#43004621)
Parsing data out of arbitrary PDFs is a cursed mission. PDF can contain images, so you might as well target JPEG directly.
OCR can take you pretty far depending on expectations, but it's never quite far enough in my experience.
Re:Show HN: HTML visualization of a PDF file's internal stru...
by themanmaran on Monday February 10, 2025 @06:37PM
(#43006736)
That's been our experience as well. Just scrapping any of the metadata associated with the PDF and treating it like an image. Since you never know when a document has a screenshot of an excel table inside.
The .NORM files (https://xkcd.com/2116)
Re:Show HN: HTML visualization of a PDF file's internal stru...
by jimjimjim on Monday February 10, 2025 @02:13PM
(#43004004)
The LLMs might help with sequencing the characters you extract from the page but actually getting the contents is still difficult. A number of times I've come across a page where the letters of the text are glyphs in a custom font with no mapping to ascii or anything similar or even more common, especially with output from CAD, are letters that are made by drawing lines in the shape of letters so there is nothing identifiable to extract and you are left with OCRing the page to double check the results
Re:Show HN: HTML visualization of a PDF file's internal stru...
by GaggiX on Monday February 10, 2025 @01:50PM
(#43003703)
It reminds me of: https://xkcd.com/1425/
In the same way now with today's AI models the task is easily achievable.
Re:Show HN: HTML visualization of a PDF file's internal stru...
by aboardRat4 on Tuesday February 11, 2025 @03:46AM
(#43010482)
mathpix does quite an awesome job actually
Re:Show HN: HTML visualization of a PDF file's internal stru...
by rad_gruchalski on Tuesday February 11, 2025 @07:34AM
(#43012061)
pdfjs does all of that and it’s pretty solid. I used it recently to extract tabular data out of 10 year batch of bank statements.
Re:Show HN: HTML visualization of a PDF file's internal stru...
by spacecadet on Tuesday February 11, 2025 @07:37AM
(#43012077)
Many moons ago worked on extracting 2D CAD drawings from PDFs and converting to full 3D. Fun times.
Re:Show HN: HTML visualization of a PDF file's internal stru...
by gsempe on Saturday February 15, 2025 @05:57AM
(#43057627)
I’m very interested on if you managed to make it works?
Re:Show HN: HTML visualization of a PDF file's internal stru...
by spacecadet on Thursday February 20, 2025 @05:31PM
(#43121194)
Yes and no. Had some initial prototype but had issues with all of the edge cases related to document formatting and detail and eventually abandoned it.
The project was in the end a complete failure and several people were upset at me for not delivering what I was supposed to.
In present day, with the capabilities that are now available with LLMs to extract data from PDFs I 100% would go the route of utilising AI to extract the data they wanted. Back then that did not yet exist.