Live data from Hacker News

Pdfsandwich

tobias-elze.de

11–20 of 65 posts

Re: Pdfsandwich

#11
post #2

Really interesting project. The source code seems to be on sourceforge.net. I site once important, but now when I see it I either think "the project is most-likely dead" or "can this project be legit? Am I getting malware here?"

I remember this is one of those sites where you're not sure which one is the actual download button to click.

Re: Pdfsandwich

#14
post #13

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

It will make the “text” on a pdf with only images searchable and selectable.

Re: Pdfsandwich

#15
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.

Re: Pdfsandwich

#16
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 said, it's not perfect, but still pretty awesome. Sometimes the spacing was off or it would confuse symbols like 1, I, or l. But these are minor and usually only on poorly scanned PDFs.

Re: Pdfsandwich

#17
post #13

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

It calls a series of open source tools that result in producing a pdf with text embedded behind an image overlay, where the image overlay is the original pdf. It was a while ago where I really looked into this but to name a few:

ImageMagick to convert the pages to images

Tesseract-ocr by Google to transcribe the text in the images, which puts it’s output into singular pdf files

Pdfunite to stitch together the pdfs back into a whole file

I’m sure I’m missing a few, iirc it can call a tool that straightens the pages as well.

EDIT: Messed around and remembered the stuff:

where a.pdf is a 2 page PDF:

>convert a.pdf a.png

makes a-0.png and a-1.png

OCR's each image:

>for x in {0..1} ; do tesseract a-$x.png a_ocr-$x PDF ; done ;

combines them into 1 PDF:

>pdfunite a_ocr-{0..1}.pdf a_ocr_combined.pdf

Re: Pdfsandwich

#18
post #5
post #2

Really interesting project. The source code seems to be on sourceforge.net. I site once important, but now when I see it I either think "the project is most-likely dead" or "can this project be legit? Am I getting malware here?"

SourceForge literally looks like one of those your-free-filez.ru style movie sites with all the fake download buttons. Same aesthetic. Just awful lol

A few years ago the company was sold and started bundling their own crap with the downloads, but apparently it was sold again and stopped doing that.

Re: Pdfsandwich

#20
post #7

Not to get all technical, but the "Cube Rule of Food" would classify this project as "pdftoast", not "pdfsandwich": https://cuberule.com/

Pdfcalzone I think. Pop tarts appear to be explicitly called out as calzones towards the bottom of the page ( enveloping the filling on all sides, though maybe there is a n alternative interpretation if you consider frosting to be the point of reference).
Post reply on HN