New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing DPI Parameter #2051
Missing DPI Parameter #2051
Conversation
Adding the |
… and require keyword-only args. In `get_pixmap()`, use Python's special `*` arg to force args to be keyword-only instead of enforcing this in the code. In `get_page_pixmap()`, also use Python's special `*` arg to force args to be keyword-only. This makes the fn conform to the documentation in docs/document.rst, but could break code that used to use non-keyword args.
Thanks for this, you've identified a genuine problem with the API. But actually i think we can make a slightly more general solution to the problem, using Python's So i don't think we'll take your PR directly, but will instead address the issue differently. Hope that's ok. [I'm not sure why you're seeing |
… and require keyword-only args. In `get_pixmap()`, use Python's special `*` arg to force args to be keyword-only instead of enforcing this in the code. In `get_page_pixmap()`, also use Python's special `*` arg to force args to be keyword-only. This makes the fn conform to the documentation in docs/document.rst, but could break code that used to use non-keyword args.
I agree that there is a more general solution. I happened to want to use the After cloning the repo, I install
|
… and require keyword-only args. In `get_pixmap()`, use Python's special `*` arg to force args to be keyword-only instead of enforcing this in the code. In `get_page_pixmap()`, also use Python's special `*` arg to force args to be keyword-only. This makes the fn conform to the documentation in docs/document.rst, but could break code that used to use non-keyword args.
…quire keyword-only args. In `get_pixmap()`, use Python's special `*` arg to force args to be keyword-only instead of enforcing this in the code. In `get_page_pixmap()`, also use Python's special `*` arg to force args to be keyword-only. This makes the fn conform to the documentation in docs/document.rst, but could break code that used to use non-keyword args.
I've pushed a separate change that addresses the issue in this PR. So I'll close this PR now. Separate from that, i can't tell what is causing the error you get from pytest. Did you build and install PyMuPDF after cloning the repository? Please open a new discussion (https://github.com/pymupdf/PyMuPDF/discussions) if you can't make progress. |
No, this is probably the issue. Can you link me to how to do this please? |
Basic instructions for building PyMuPDF from source are at: https://pymupdf.readthedocs.io/en/latest/installation.html#install-from-source-without-using-an-sdist. These assume that you know what you are doing though. The suggested command there, Alternatives are:
In both cases, make sure to not be in the PyMuPDF directory when you run you python script otherwise, confusingly, Python will attempt to import |
Perfect. |
Fixed in PyMuPDF-1.21.1. |
The documentation for
get_page_pixmap
states thatPage.get_pixmap()
is invoked and includes*args, **kwargs
as function parameters. However, passingdpi
inget_page_pixmap
yieldsTypeError: get_page_pixmap() got an unexpected keyword argument 'dpi'
. This change fixes this behavior.