Skip to content
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

Support saving PDF with different X and Y resolutions #6961

Merged

Conversation

jvanderneutstulen
Copy link
Contributor

This is useful for converting tiffg3 (fax) images to pdf, which have split dpi like (204,391), (204,196) or (204,98).

Changes proposed in this pull request:

  • Add a dpi parameter to the PDF save function, which accepts a tuple with X and Y dpi.

Add a `dpi` parameter to the PDF save function, which accepts
a tuple with X and Y dpi.
This is useful for converting tiffg3 (fax) images to pdf,
which have split dpi like (204,391), (204,196) or (204,98).
@radarhere radarhere changed the title Support saving PDF with different X and Y resolution. Support saving PDF with different X and Y resolution Feb 21, 2023
@radarhere
Copy link
Member

radarhere commented Feb 22, 2023

This was previously attempted in #3764 and #3767.

For the record, would you be able to attach one such PDF, that you've found in the wild?

@jvanderneutstulen
Copy link
Contributor Author

I have attached a received fax tiffg3 document in SuperFine resolution, and the pdf the fax software produces from this tiff (using an ancient tiff2pdf).
test-superfine.zip
test-superfine-tiff2pdf.pdf

@radarhere
Copy link
Member

Thanks. I've created jvanderneutstulen#1 with some suggestions.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little formatting nit, otherwise looks good.

docs/handbook/image-file-formats.rst Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@radarhere radarhere merged commit 4777379 into python-pillow:main Feb 24, 2023
@radarhere radarhere changed the title Support saving PDF with different X and Y resolution Support saving PDF with different X and Y resolutions Feb 24, 2023
radarhere added a commit to radarhere/Pillow that referenced this pull request Mar 4, 2023
radarhere added a commit to radarhere/Pillow that referenced this pull request Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants