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

Wrong image converted #258

Open
juhonkang opened this issue Mar 5, 2023 · 2 comments
Open

Wrong image converted #258

juhonkang opened this issue Mar 5, 2023 · 2 comments

Comments

@juhonkang
Copy link

I use pdf2image to turn to pdf to image, however, the image is corrupted like this
image

# use pdf2image to convert pdf to image
from pdf2image import convert_from_path

images = convert_from_path('data/Dev_data/All_robert_bosch/exception/IV WGEPEN230072.pdf', dpi=600)


save_fp = 'data/Dev_data/All_robert_bosch/exception/IV WGEPEN230072.pdf'

images[0].save('data/Dev_data/All_robert_bosch/exception/IV WGEPEN230072_.png', 'PNG')

images[0].save(
    save_fp, "PDF" ,resolution=100.0, save_all=True, append_images=images[1:]
)

data link: https://we.tl/t-B1CT1CG4hB

@juhonkang
Copy link
Author

password is: "nahnah"

@Belval
Copy link
Owner

Belval commented Mar 6, 2023

This is a common issue when fonts are missing from the OS where pdf2image is installed. You can search the closed issues for a solution that might work for you: https://github.com/Belval/pdf2image/issues?q=is%3Aissue+missing+font+is%3Aclosed but make sure that poppler-data is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants