Live data from Hacker News

Pdfsandwich

tobias-elze.de

31–40 of 65 posts

Re: Pdfsandwich

#31
post #6

Interesting. I've used ocrmypdf for this a lot - https://ocrmypdf.readthedocs.io/en/latest/

I tried both recently on a scanned, color document recently. pdfsandwich gave me really unpleasant, monochrome, and blown out results; ocrmypdf did what I expected, giving me a searchable pdf.

Re: Pdfsandwich

#32
post #13

Could someone explain what this does? The explanation paragraph does not make sense to me grammatically.

It converts images to text.

The input is a scanned PDF. The output is the same PDF with the recognized text on top, in a transparent font.

Copy and paste now works because when you click the PDF you are selecting the transparent text.

Re: Pdfsandwich

#33

Using Pdfsandwich in college was like having a superpower. We would often be given PDFs with only image data. While my peers were still scrolling through and copying quotes by hand, I was there in seconds with Ctrl-F to find and copy/paste. Once you have text in the PDF, you can use any sort of text analysis tools. You can use tools to convert it to plain text and grep through, or anything else you want. That being s…

On an even more macro level I've had a great experience with ripgrep-all[0], which uses Tesseract internally.

I have e.g. a directory with all weekly lecture slides for one lecture, and can directly find where (both file and page) we learned something related to photosynthesis via `rga photoshynthesis`.

[0]: https://github.com/phiresky/ripgrep-all

Re: Pdfsandwich

#34
I wonder if we (like in "humanity") can live without PDF at all? The format has so many flaws and problems it is practically unusable for any task except producing a paper copy, which is progressively obsolete with all the displays and e-paper readers and mobile phones.

Re: Pdfsandwich

#35
post #13

Could someone explain what this does? The explanation paragraph does not make sense to me grammatically.

As far as I understand, it takes a PDF that contains only image data (e.g. a scan of a price of paper) and uses OCR to recognize the text, then overlays the text on top of the image in the output PDF. It would allow you to take a physically scanned document and create a PDF with selectable text you could copy+paste, search over, etc.

Text is behind the image, as the first 'graph of TFA notes:

the text will be added to each page invisibly "behind" the images.

Re: Pdfsandwich

#36
It’s kind of funny to open this site on an iPad and have iOS just let you select text from images (it does its own on-device OCR now), but I wish the layering described was standard on any PDF generation software (for indexing purposes).

Re: Pdfsandwich

#38
post #34

I wonder if we (like in "humanity") can live without PDF at all? The format has so many flaws and problems it is practically unusable for any task except producing a paper copy, which is progressively obsolete with all the displays and e-paper readers and mobile phones.

PDF is quite good at producing static output that will render predictably, and there aren't really any common alternatives for this. PDF becomes very problematic when you attempt to do anything else with it though, like edit it or parse it as input.

Re: Pdfsandwich

#39
post #34

I wonder if we (like in "humanity") can live without PDF at all? The format has so many flaws and problems it is practically unusable for any task except producing a paper copy, which is progressively obsolete with all the displays and e-paper readers and mobile phones.

PDF is quite good at producing static output that will render predictably, and there aren't really any common alternatives for this. PDF becomes very problematic when you attempt to do anything else with it though, like edit it or parse it as input.

Or like reading it on a screen size other than a printer paper.

Re: Pdfsandwich

#40
post #34

I wonder if we (like in "humanity") can live without PDF at all? The format has so many flaws and problems it is practically unusable for any task except producing a paper copy, which is progressively obsolete with all the displays and e-paper readers and mobile phones.

And don't even get me started on sustainability. I wonder how much trees we lose yearly because printing is the most convenient way to interact with a PDF document.
Post reply on HN