LoginSignup
1
1

More than 1 year has passed since last update.

pymupdfを使ってpdfのwidthとheightを取得する

Posted at

使用バージョン

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公式ドキュメント

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1