Live data from Hacker News

Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

github.com

51–60 of 95 posts

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#51
post #5
post #2

who would be interested by an online website doing the job?

For what it's worth, here's a service that does that https://documentalchemy.com/demo/pdf2txt (and more: https://documentalchemy.com/demo )

thanks for sharing this one, didn't know it.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#54
post #41

Earlier quoted context omitted.

I find it absolutely ridiculous that we have to resort to these kinds of tools :/ We have digital formats, and we decided to standardize document distribution on the one that makes it as hard to extract data as if it were on physical paper.

PDF is a perfectly fine and rich digital format. It also allows you to do proper copy and paste, which is much saner than anything paper offers. Sure, PDF is a light on context clues for automation and is targeted purely at humans. But formats targeted at both computers and humans consistently fail (XML with accompanying XSLT comes to mind), and/or only have terrible tools for creating files (easily parsable, pretty…

HTML is a viable alternative. And it is something everyone can parse easily, better yet if the data is tagged with classes somehow.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#55
post #50

Earlier quoted context omitted.

PDF is not very fine. Copy-paste from PDF very often results in complete rubbish, even when it is not deliberately prevented (which the format allows, and then you have to do OCR).

People purposefully disallowing copy-paste isn't a problem with PDF: in other formats they would have embedded a picture, at least with PDF you get the other advantages of proper text: infinite zoom and great compression. Sadly there's also a lot of PDFs that are little more than a picture collection that looks like text, but that's hardly the file format's fault. It really is a problem with PDF that it's too easy to…

When the PDF is a picture collection that looks like text that's when PDF is being used correctly, because that's when something was scanned out of paper and put on a paper-like format for computers, PDF.

When people write text and data and tables on the computer then put it on a paper-like format to share that's when the problem happens.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#56
post #10

This is important for (al)pine users ... when reading email in a terminal it is very useful to be able to open a PDF attachment as text and view it in the (terminal) mailtool ... Yes, (al)pine is my mailtool in 2017.

Also mutt, which I've switched back to recently. I've got a little Atom powered Chromebook converted to Linux that just does not like modern heavy webmail clients(even GMail when it was still running ChromeOS, and this is one still on the market, Acer CB3-131) so a combination of mutt, mbsync, and msmtp is a much nicer combo. Mutt is a terrific mail reader but its internal SMTP and IMAP handling can be a bit iffy, he…

Mutt + mbsync + msmtp is my setup too. I'm using Neomutt, since that's being actively maintained by a sizeable community of friendly people.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#57
post #54
post #41

Earlier quoted context omitted.

PDF is a perfectly fine and rich digital format. It also allows you to do proper copy and paste, which is much saner than anything paper offers. Sure, PDF is a light on context clues for automation and is targeted purely at humans. But formats targeted at both computers and humans consistently fail (XML with accompanying XSLT comes to mind), and/or only have terrible tools for creating files (easily parsable, pretty…

HTML is a viable alternative. And it is something everyone can parse easily, better yet if the data is tagged with classes somehow.

That's something that should be pushed by the developer community, I think. Perhaps having an HTML client for people who nowadays use PDF writers and readers, with the option to tag data in some easily parseable format (if the data isn't already coming in a table).

This should output a single file and ideally it should have some way of ensuring the author it won't be modified unnoticed (that's one of the features common people use PDF for, today, they think it is something no one can modify) -- perhaps signing it with a key from Keybase would work in the mid term.

https://github.com/iffy/lhtml has something going in this direction.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#58
post #57
post #54

Earlier quoted context omitted.

HTML is a viable alternative. And it is something everyone can parse easily, better yet if the data is tagged with classes somehow.

That's something that should be pushed by the developer community, I think. Perhaps having an HTML client for people who nowadays use PDF writers and readers, with the option to tag data in some easily parseable format (if the data isn't already coming in a table). This should output a single file and ideally it should have some way of ensuring the author it won't be modified unnoticed (that's one of the features com…

epub is html-based, and their standards body recently got absorbed by the W3C. I think it would be a fine replacement for some of the uses that PDF gets (such as distributing research papers). Unfortunately I don't see it happening any time soon, PDF is so ubiquitous right now and there's very few tools that let you "save to epub". Chicken & egg.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#59
post #16

For those interested in converting PDF tables into CSV, there's also Tabula ( http://tabula.technology/ ) (Used by many journalists to analyze the data in PDFs)

I didn't know about Tabula and i've given a try at the instant. Apparently it only extracts tables and ignores everything around. This might be good in some cases but it is a problem if you want to extract a form, a whole textbook, your bank statements or anything. Also, I noticed that Tabula has some slight troubles when columns are not drawn in the table. But overall it is a good tool for extracting only tables, that's true.

Re: Show HN: PDFLayoutTextStripper – Converts PDF to text while keeping the layout

#60
post #16

For those interested in converting PDF tables into CSV, there's also Tabula ( http://tabula.technology/ ) (Used by many journalists to analyze the data in PDFs)

I find it absolutely ridiculous that we have to resort to these kinds of tools :/ We have digital formats, and we decided to standardize document distribution on the one that makes it as hard to extract data as if it were on physical paper.

I had to use Tabula to extract a decade of SAT scores from PDFs for each state/year. It was a nightmare, but I managed it. More recently, I was hoping to do something similar with decennial census data, but it was just too much. Far, far too many groups publish data to PDF, which is about as bad as if they just deleted it straight-out. It's very upsetting.
Post reply on HN