Skip to content

Commit

Permalink
DOC: Small changes to PaperSize notes (#2834)
Browse files Browse the repository at this point in the history
Plus one typo in xmp.py.
  • Loading branch information
j-t-1 authored Sep 6, 2024
1 parent e694d55 commit b85c171
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions pypdf/papersizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ class Dimensions(NamedTuple):
class PaperSize:
"""(width, height) of the paper in portrait mode in pixels at 72 ppi."""

# Notes how to calculate it:
# 1. Get the size of the paper in mm
# 2. Convert it to inches (25.4 millimeters are equal to 1 inches)
# 3. Convert it to pixels ad 72dpi (1 inch is equal to 72 pixels)
# Notes of how to calculate it:
# 1. Get the size of the paper in millimeters
# 2. Convert it to inches (25.4 millimeters is equal to 1 inch)
# 3. Convert it to pixels at 72dpi (1 inch is equal to 72 pixels)

# All Din-A paper sizes follow this pattern:
# 2xA(n-1) = A(n)
# 2 x A(n - 1) = A(n)
# So the height of the next bigger one is the width of the smaller one
# The ratio is always approximately the ratio 1:2**0.5
# The ratio is always approximately 1:2**0.5
# Additionally, A0 is defined to have an area of 1 m**2
# https://en.wikipedia.org/wiki/ISO_216
# Be aware of rounding issues!
A0 = Dimensions(2384, 3370) # 841mm x 1189mm
A1 = Dimensions(1684, 2384)
Expand Down
2 changes: 1 addition & 1 deletion pypdf/xmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _get_text(self, element: XmlElement) -> str:
"""Unique identifier of the work from which this resource was derived."""

dc_subject = property(_getter_bag(DC_NAMESPACE, "subject"))
"""An unordered array of descriptive phrases or keywrods that specify the
"""An unordered array of descriptive phrases or keywords that specify the
topic of the content of the resource."""

dc_title = property(_getter_langalt(DC_NAMESPACE, "title"))
Expand Down

0 comments on commit b85c171

Please sign in to comment.