Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow images to be the inputs, NOT just PDFs [convert images to searchable pdfs] #23

Open
ElectricRCAircraftGuy opened this issue Jun 28, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ElectricRCAircraftGuy
Copy link
Owner

ElectricRCAircraftGuy commented Jun 28, 2022

Add these features:

# allow using images as input
pdf2searchablepdf in.jpg in2.jpeg in3.png in4.tif in5.tiff

# alias it as `img2searchablepdf` too:
# (same as above)
img2searchablepdf in.jpg in2.jpeg in3.png in4.tif in5.tiff

# etc

Allow passing in 1 or more image files to be converted into a PDF! Support ALL image types that tesseract supports, such as:

.jpg
.jpeg
.png
.tif
.tiff
.gif
.bmp

etc.

Sloppy work-around

Meanwhile, you can convert images to PDF with img2pdf, like this. See: https://stackoverflow.com/a/8955457/4561887

# 1. convert images to PDF
img2pdf img1.png img2.jpg -o out.pdf

# 2. then convert that PDF to a searchable PDF
pdf2searchablepdf out.pdf

Or, just use tesseract directly, since it takes images as inputs.

OR, a hacky work-around that works right now in pdf2searchablepdf version 0.5.0:

mkdir -p temp \
    && cp "img.jpg" temp \
    && pdf2searchablepdf temp \
    && mv "temp_searchable.pdf" "img.pdf"
# then manually delete the "temp" dir when done
@ElectricRCAircraftGuy ElectricRCAircraftGuy added the enhancement New feature or request label Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant