We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba73d7c commit c15e907Copy full SHA for c15e907
1 file changed
pdfly/up2.py
@@ -21,9 +21,14 @@ def main(pdf: Path, output: Path) -> None:
21
lhs.merge_translated_page(
22
rhs, tx=float(lhs.mediabox.width), ty=0, expand=True
23
)
24
+ # Lucas: expand=True triggers a mediabox size update in PageObject._expand_mediabox(),
25
+ # but sometimes the cropbox is also update in the process, sometimes it doesn't.
26
+ # I haven't investigated why, but maybe because those attributes are properties
27
+ # created with _create_rectangle_accessor().
28
+ # Anyway, for now I prefer to ensure that the cropbox matches the mediabox:
29
+ lhs.cropbox = lhs.mediabox
30
writer.add_page(lhs)
31
sys.stdout.flush()
-
32
with open(output, "wb") as fp:
33
writer.write(fp)
34
print(f"{output} was created")
0 commit comments