Live data from Hacker News

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

github.com

81–90 of 95 posts

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

#81
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…

> It also allows you to do proper copy and paste, which is much saner than anything paper offers. Technically it does that, yes. Rarely do I see people taking advantage of it, though; most of the times I tried to copy some text out of PDF, the result had to undergo a significant cleanup before becoming usable.

I've had similar experiences, as well as worse; one PDF I got from a bank about my student loans a year or so back had ostensibly only text content, but none of it was even able to be selected.

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

#82
post #29

Earlier quoted context omitted.

I use alpine in 2017. It's easy to use, pluggable, and faster than any GUI I've touched.

As do I, because it's faster than browser based email and many GUI clients (like Thunderbird). I also like the fact that I can just copy across my .pinerc file to a new computer and my mail client is setup. I had not considered the PDF issue. I just open them with an external application. The potential of reading them within Alpine hadn't occurred to me, but now it has, I want it!

Something like:

    application/pdf;pdftotxt %s /tmp/pdftxt && less /tmp/pdftxt
In your MAILCAP file?

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

#83
post #79

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 fucked up beyond all doubt. But there seems to be no better (even if unpopular) alternative. How do you imagine a better format PDF alternative? On the one hand, we have text-based formats. They are not serialization of the exact rendering. On the other hand, we have ps, which is, probably, too complex to be manipulated as text when rendered. PDF and dejavu do kinda both, even if quite imperfectly. So how do w…

Microsoft XPS?

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

#84
post #76
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…

PDF has no paragraphs, often not even words. No concept of font notes. It doesn't flow well with different screen sizes. If you designed a real bad format on purpose, it would be hard to top PDF. Maybe Photoshop files are worse.

Have you seen the spec for .doc and .xls ?

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

#85
post #79

Earlier quoted context omitted.

PDF is fucked up beyond all doubt. But there seems to be no better (even if unpopular) alternative. How do you imagine a better format PDF alternative? On the one hand, we have text-based formats. They are not serialization of the exact rendering. On the other hand, we have ps, which is, probably, too complex to be manipulated as text when rendered. PDF and dejavu do kinda both, even if quite imperfectly. So how do w…

epub is the way to go I think. PDF is an overengineered abomination. It nicely serves the purpose of "there is only one and exactly one way to render this", but then again, just about so does an image. I also think that, with more love, epub could get there too. It's not an easy problem, but if we can crack SHA-1 I'm sure we can crack this one too :)

I don't see how epub can be pixel-perfect. It's almost as much a markup format, as fb2. Clearly more explanation of how should it be done is in order.

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

#86
post #79

Earlier quoted context omitted.

PDF is fucked up beyond all doubt. But there seems to be no better (even if unpopular) alternative. How do you imagine a better format PDF alternative? On the one hand, we have text-based formats. They are not serialization of the exact rendering. On the other hand, we have ps, which is, probably, too complex to be manipulated as text when rendered. PDF and dejavu do kinda both, even if quite imperfectly. So how do w…

Microsoft XPS?

This is interesting. I never considered this one. How is it inferior to PDF, so that it is so much less widely spread?

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

#87
post #75
post #30

Earlier quoted context omitted.

Tabula is the nice free tool but requires technical background to run it. There is a free https://pdf.co with both online and offline tools (Windows) for PDF to CSV. (disclaimer: i work on it)

Hi there. We try to make a tool that's as simple to use as possible (given the constraints of a volunteer-run project such as Tabula). What technical background do you think is required to use it? (disclaimer: I'm the main author of Tabula)

hi and thank you for your work on Tabula! Well, some months ago I've advised to try Tabula and the first thing was the Java download page opened without any explanation. She managed to install java runtime and to try again but when was trying to upload files it was displaying either internal server error in jruby message or just a plain json in the browser. So, in my opinion and experience it may require some efforts to run it (at least for the first time). But to _use_ it, for sure, no such a technical background is required.

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

#88
post #76

Earlier quoted context omitted.

PDF has no paragraphs, often not even words. No concept of font notes. It doesn't flow well with different screen sizes. If you designed a real bad format on purpose, it would be hard to top PDF. Maybe Photoshop files are worse.

Have you seen the spec for .doc and .xls ?

I don't even want to know :)

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

#89
post #85

Earlier quoted context omitted.

epub is the way to go I think. PDF is an overengineered abomination. It nicely serves the purpose of "there is only one and exactly one way to render this", but then again, just about so does an image. I also think that, with more love, epub could get there too. It's not an easy problem, but if we can crack SHA-1 I'm sure we can crack this one too :)

I don't see how epub can be pixel-perfect. It's almost as much a markup format, as fb2. Clearly more explanation of how should it be done is in order.

Pixel perfection is not necessary for 99.999% of the cases PDF is used in.

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

#90
post #86

Earlier quoted context omitted.

Microsoft XPS?

This is interesting. I never considered this one. How is it inferior to PDF, so that it is so much less widely spread?

It's not as versatile (no forms, for example), but layout- and prepress-wise it seems to be as good as PDF (with the benefit that it retains the structure).
Post reply on HN