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

In the cat subcommand, replace the usage of the deprecated PdfMerger class from pypdf #31

Closed
Lucas-C opened this issue Oct 13, 2023 · 0 comments · Fixed by #34
Closed

Comments

@Lucas-C
Copy link
Member

Lucas-C commented Oct 13, 2023

PdfMerger is used in the in the cat subcommand: https://github.com/py-pdf/pdfly/blob/main/pdfly/cat.py#L51

But this class is deprecated in pypdf since version 3.9.1: https://github.com/py-pdf/pypdf/releases/tag/3.9.1

We should replace it by combining PdfReader, its merge_page() method & PdfWriter from pypdf.
An example of code using those can be found there: https://py-pdf.github.io/fpdf2/CombineWithPypdf.html

Extra unit tests could be added in the process in https://github.com/py-pdf/pdfly/blob/main/tests/test_cat.py
in order to ensure that pdfly cat still works similarly as it currently does.

MartinThoma pushed a commit that referenced this issue Dec 16, 2023
…Merger by PdfWriter (#34)

Replaced the deprecated pypdf.PdfMerger with pypdf.PdfReader

Closes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant