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

BUG: Prevent updating page contents after merging page (stamping/watermarking) #1952

Merged
merged 6 commits into from
Jul 9, 2023

Conversation

pubpub-zz
Copy link
Collaborator

@pubpub-zz pubpub-zz commented Jul 8, 2023

add also over param in merge_page

closes #1951
closes #1953

add also over param in merge_page

closes py-pdf#1951
@pubpub-zz pubpub-zz changed the title BUG : prevent updating page contents BUG : prevent updating page contents after merging page (stamping/watermarking) Jul 8, 2023
@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (8753663) 93.93% compared to head (69377ca) 93.93%.

❗ Current head 69377ca differs from pull request most recent head 7efec4f. Consider uploading reports for the commit 7efec4f to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1952   +/-   ##
=======================================
  Coverage   93.93%   93.93%           
=======================================
  Files          33       33           
  Lines        6993     6996    +3     
  Branches     1386     1388    +2     
=======================================
+ Hits         6569     6572    +3     
  Misses        273      273           
  Partials      151      151           
Impacted Files Coverage Δ
pypdf/_page.py 93.75% <100.00%> (+0.02%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pubpub-zz
Copy link
Collaborator Author

@MartinThoma
all yours
I let you decide/adjust for additional argument in merge_page

@MartinThoma MartinThoma changed the title BUG : prevent updating page contents after merging page (stamping/watermarking) BUG: Prevent updating page contents after merging page (stamping/watermarking) Jul 9, 2023
@MartinThoma
Copy link
Member

Thank you!

I'll check it today, but it might be in the evening :-)

pubpub-zz and others added 2 commits July 9, 2023 14:12
Co-authored-by: Martin Thoma <info@martin-thoma.de>
Co-authored-by: Martin Thoma <info@martin-thoma.de>
pypdf/_page.py Outdated
@@ -972,7 +977,9 @@ def replace_contents(
# this will be fixed with the _add_object
self[NameObject(PG.CONTENTS)] = content

def merge_page(self, page2: "PageObject", expand: bool = False) -> None:
def merge_page(
self, page2: "PageObject", over: bool = True, expand: bool = False
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self, page2: "PageObject", over: bool = True, expand: bool = False
self, page2: "PageObject", expand: bool = False, over: bool = True

@MartinThoma MartinThoma merged commit abd8342 into py-pdf:main Jul 9, 2023
10 checks passed
MartinThoma added a commit that referenced this pull request Jul 9, 2023
Bug Fixes (BUG):
-  Prevent updating page contents after merging page (stamping/watermarking) (#1952)
-  % to be hex encoded in names (#1958)
-  Inverse color in CMYK images (#1947)
-  Dates conversion not working with Z00\'00\' (#1946)
-  Support UTF-16-LE Strings (#1884)

[Full Changelog](3.12.0...3.12.1)
MartinThoma added a commit that referenced this pull request Jul 9, 2023
Bug Fixes (BUG):
-  Prevent updating page contents after merging page (stamping/watermarking) (#1952)
-  % to be hex encoded in names (#1958)
-  Inverse color in CMYK images (#1947)
-  Dates conversion not working with Z00\'00\' (#1946)
-  Support UTF-16-LE Strings (#1884)

[Full Changelog](3.12.0...3.12.1)
@pubpub-zz pubpub-zz deleted the Watermark branch September 2, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change in behavior from 3.10.0 to 3.11.0 Huge file produced when merging (watermarking/stamping)
2 participants