I want to convert pdf text to image in python thats why im using pdf2image library.Now I'am able to convert only one pdf file. I have to convert multiple file from the folder. https://i.stack.imgur.com/gnxKK.png
Asked
Active
Viewed 42 times
-1
-
1would you mind adding your code as formatted text instead of adding a link to an image? – lmiguelvargasf Mar 08 '19 at 05:04
1 Answers
1
This post is definitely something you should read. If you are newer to programming in general, you should also read up on Recursion and what it is (for-loops mainly).
Something like this may help you get to where you need to be but you will need to change it for your application. This uses 2 libraries that don't need to be installed manually (they come with python) os (which you are probably already using) and glob.
import os
from pdf2image import convert_from_path
import glob
path = os.path.dirname(__file__)
for filename in glob.glob(os.path.join(path, '*.pdf')):
pages = convert_from_path(filename)
Column01
- 142
- 1
- 12