|
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
|
|
# See the License for the specific language governing permissions and |
|
|
# limitations under the License. |
|
|
# limitations under the License. |
|
|
# |
|
|
# |
|
|
|
|
|
import io |
|
|
|
|
|
|
|
|
import pdfplumber |
|
|
import pdfplumber |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pdf_pages(fnm) |
|
|
pdf_pages(fnm) |
|
|
return |
|
|
return |
|
|
try: |
|
|
try: |
|
|
images.append(Image.open(fnm)) |
|
|
|
|
|
|
|
|
fp = open(fnm, 'rb') |
|
|
|
|
|
binary = fp.read() |
|
|
|
|
|
fp.close() |
|
|
|
|
|
images.append(Image.open(io.BytesIO(binary)).convert('RGB')) |
|
|
outputs.append(os.path.split(fnm)[-1]) |
|
|
outputs.append(os.path.split(fnm)[-1]) |
|
|
except Exception: |
|
|
except Exception: |
|
|
traceback.print_exc() |
|
|
traceback.print_exc() |