posted at 2022-04-27
python==3.8 PyMuPDF==1.19.6
import fitz target_path = "xxx/yyy.pdf" # pathlibを用いたパスでも良い doc = fitz.open(target_path) page_num = 0 page = doc.load_page(page_num) pdf_width = page.rect.width pdf_height = page.rect.height
PyMuPDF公式ドキュメント
Register as a new user and use Qiita more conveniently