I would like to save some of my photos of documents / receipts to PDF (with OCR). On iOS, I can use apps like Adobe Scan and Scanner Pro. However, on macOS, I have only found a couple. Curious what others are using for this purpose. Thanks!
Preview will export a jpg as a PDF with a couple of mouse clicks. File â Export as PDF.
PS to my earlier reply: Preview will convert the image to a PDF, but it wonât be a searchable (i.e., OCRâd) PDF.
Repository on Github that might help you out
JPG-to-PDF
Simple Python script to create a PDF file from a set of images within seconds.
Thanks @John_Shelburne, Iâll check that out. Looks like I will need to pre-crop the images before using the Python script. It doesnât mention OCR, so will see if that is included.
Github has to have a tool that is open source that you can use. I will take a look this week because this is a really good idea and I need to probably convert a lot of my images to different format.
Thereâs a command line tool - OCRmyPDF
Thereâs also a similar discussion over on the KM forum fwiw
Thanks. What KM forum are you referring to?
Iâm curious. If youâre taking photos of documents, are you using your Mac camera, or are you using your phone? If the latter, the capability is built into the OS, I believe. Certainly multiple apps support this kind of thing with a very âplain, Apple-likeâ interface.
Personally, I use KeepIt from Reinvented Software. I open it on my phone, hit the + button, and it auto-takes and squares up the photo, then lets me name it and choose a location (in KeepIt). KeepIt uses iCloud and therefore I have everything on every device with zero effort.
KeepIt also integrates into macOS so you can âPrint PDF to KeepItâ or use the share sheet.
The documentation for OCRmyPDF lists multiple different options for generating a PDF when you are starting with images. Note that all of these use command line tools.
-
Tesseract is the underlying tool that OCRmyPDF uses for doing OCR. It accepts images as input. Therefore, if you are starting with images, you can just feed them directly to Tesseract and it will generate an OCRâd PDF. There is no need for OCRmyPDF to extract the images from an existing PDF and pass them to Tesseract. The downside is that you lose some of OCRmyPDFâs more advanced image cleanup features, but if you have good clean images to start with, that is probably not a concern, and this would be the simplest root.
-
img2pdf is a third-party tool which OCRmyPDF recommends as a good tool for converting/combining images into a PDF document. It is favored because it is lossless (it does not degrade the image quality) unlike various other tools. You can then feed the output of img2pdf to OCRmyPDF for OCR processing.
Of note is that while this is a command line Python script, it also does have an optional GUI for setting options etc. However, the GUI does not display input or output so itâs of limited usefulness.
-
You can feed an image directly into OCRmyPDF and it will output a OCRâd PDF. However, this will only work for a single image/page. If you need more than one page, one of the other options would need to be utilized.
The documentation mentions a few other options for converting images to PDF, but does not recommend them because they tend to degrade image quality, which would reduce the quality of the OCR output.
For those who prefer to avoid command line tools, I just noticed that the Tesseract documentation includes a list of GUI frontends which wrap Tesseract. Some of them only accept images as input while others accept PDF input. Some output text while other generate OCRâd PDFs. And they donât all work on all platforms. However, there are many options listed. It is likely that one would work for your use case. I havenât used any of them personally, so I canât make any specific recommendations.
@zkarj, I use my phone to take the pictures. I usually use tools in iOS to convert to PDF, but occasionally I am at my Mac and want to do the work there rather than pulling out my phone. I know, kind of a first world problemâŚ