arminstraub / krop

A simple graphical tool to crop the pages of PDF files, written in Python/Qt
http://arminstraub.com/software/krop
GNU General Public License v3.0
116 stars 16 forks source link

support pikepdf instead of pypdf2 #36

Closed lianghongzhuo closed 1 year ago

lianghongzhuo commented 1 year ago

a known issue is when using gs to optimize pdf the rotation does not work.

arminstraub commented 1 year ago

Thank you, Hongzhuo! This is great! Adding support for pikepdf has been on my TODO list for a long time. (My apologies for the horribly long silence due to too little time.)

Similar to what you did in this pull request, I have just added support for pikepdf. However, unlike your proposed code, I did not want to drop support for pypdf but instead support both pikepdf and pypdf. The current version defaults to pypdf but automatically selects pikepdf if pypdf is not available. Use of pikepdf can be explicitly requested using the new command line option --use-pikepdf.

Your help is much appreciated! I have added thanks to you in the ChangeLog :)