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

DOC: Small changes to PaperSize notes #2834

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading