Skip to content
Discussion options

You must be logged in to vote

Thanks for asking ... this may be confusing, but has a simple explanation.

For example take this image:
Its dimension is 607 x 741 pixels, its DPI is 120 x 120.

When opened as a document, the corresponding page size is:

page.rect
Rect(0.0, 0.0, 364.20001220703125, 444.6000061035156)

The computation works as follows, taking rect.width as an example:

(img width in pixels) / (x-dpi) * (points per inch)  = page.rect.width
      607             /   120   *        72          = 364.2

Or conversely:

page.rect.width * 120 / 72
607.0000203450521
# the original image x-pixels

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Jianpeng-teng
Comment options

Answer selected by Jianpeng-teng
Comment options

You must be logged in to vote
3 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

@Jianpeng-teng
Comment options

Comment options

You must be logged in to vote
1 reply
@Jianpeng-teng
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
not a bug not a bug / user error / unable to reproduce question
2 participants
Converted from issue

This discussion was converted from issue #1968 on October 16, 2022 07:15.