Mercurial > hgrepos > Python2 > PyMuPDF
comparison tests/test_page_links.py @ 1:1d09e1dec1d9 upstream
ADD: PyMuPDF v1.26.4: the original sdist.
It does not yet contain MuPDF. This normally will be downloaded when
building PyMuPDF.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:37:51 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 1:1d09e1dec1d9 |
|---|---|
| 1 import pymupdf | |
| 2 | |
| 3 import os | |
| 4 | |
| 5 | |
| 6 def test_page_links_generator(): | |
| 7 # open some arbitrary PDF | |
| 8 path = os.path.abspath(f"{__file__}/../../tests/resources/2.pdf") | |
| 9 doc = pymupdf.open(path) | |
| 10 | |
| 11 # select an arbitrary page | |
| 12 page = doc[-1] | |
| 13 | |
| 14 # iterate over pages.links | |
| 15 link_generator = page.links() | |
| 16 links = list(link_generator) | |
| 17 assert len(links) == 7 |
