Skip to content

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

@ElectricRCAircraftGuy

Description

@ElectricRCAircraftGuy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions