This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pdf2image import convert_from_path | |
from PIL import Image | |
def pdf_to_single_image(pdf_path, output_path, dpi=150): | |
pages = convert_from_path(pdf_path, dpi=dpi) | |
# 最初のページのサイズを取得 | |
width, height = pages[0].size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker container run -it --name tmp-name --mount type=bind,source="$(pwd)"/data/,target=/mnt --rm python:3.10.8-slim-bullseye bash |