pyPDFeditor-GUI 3.0.6__tar.gz → 3.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/PKG-INFO +5 -5
  2. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/README.md +4 -4
  3. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/PKG-INFO +5 -5
  4. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/__init__.py +1 -1
  5. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/application.py +9 -3
  6. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/functions.py +17 -14
  7. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/LICENSE +0 -0
  8. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/SOURCES.txt +0 -0
  9. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/dependency_links.txt +0 -0
  10. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/entry_points.txt +0 -0
  11. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/requires.txt +0 -0
  12. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pyPDFeditor_GUI.egg-info/top_level.txt +0 -0
  13. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/__main__.py +0 -0
  14. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/Add.svg +0 -0
  15. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/Add_h.svg +0 -0
  16. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/Add_p.svg +0 -0
  17. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/Photo.svg +0 -0
  18. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/__init__.py +0 -0
  19. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/arrow_move.svg +0 -0
  20. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/book2.svg +0 -0
  21. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/chevron_down.svg +0 -0
  22. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/color.svg +0 -0
  23. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/color_h.svg +0 -0
  24. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/color_p.svg +0 -0
  25. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/delete.svg +0 -0
  26. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/delete_h.svg +0 -0
  27. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/delete_p.svg +0 -0
  28. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/dismiss.svg +0 -0
  29. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/dismiss_h.svg +0 -0
  30. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/down.svg +0 -0
  31. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/down_h.svg +0 -0
  32. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/down_p.svg +0 -0
  33. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/edit.svg +0 -0
  34. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/folder.svg +0 -0
  35. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/folder_d.svg +0 -0
  36. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/folder_h.svg +0 -0
  37. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/folder_p.svg +0 -0
  38. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/font.svg +0 -0
  39. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/font_h.svg +0 -0
  40. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/font_p.svg +0 -0
  41. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/home.svg +0 -0
  42. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/lock.svg +0 -0
  43. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/maximize.svg +0 -0
  44. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/merge.svg +0 -0
  45. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/metadata.svg +0 -0
  46. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/minimize.svg +0 -0
  47. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/more.svg +0 -0
  48. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/more_d.svg +0 -0
  49. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/more_h.svg +0 -0
  50. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/more_p.svg +0 -0
  51. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/move_page.svg +0 -0
  52. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/pdf icon.svg +0 -0
  53. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/rotate_anticlockwise.svg +0 -0
  54. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/rotate_clockwise.svg +0 -0
  55. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/settings.svg +0 -0
  56. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/settings_h.svg +0 -0
  57. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/settings_p.svg +0 -0
  58. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/square_multiple.svg +0 -0
  59. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/sync.svg +0 -0
  60. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/sync_h.svg +0 -0
  61. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/sync_p.svg +0 -0
  62. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/view.svg +0 -0
  63. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/view_h.svg +0 -0
  64. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/icons/view_p.svg +0 -0
  65. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/language.py +0 -0
  66. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/style_sheets.py +0 -0
  67. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/window_effect.py +0 -0
  68. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/pypdfeditor_core/windows.py +0 -0
  69. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/setup.cfg +0 -0
  70. {pypdfeditor_gui-3.0.6 → pypdfeditor_gui-3.0.7}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyPDFeditor-GUI
3
- Version: 3.0.6
3
+ Version: 3.0.7
4
4
  Summary: A desktop application to edit PDF files.
5
5
  Home-page: https://github.com/Augus1999/pyPDFeditor-GUI/
6
6
  Author: Nianze A. TAO
@@ -36,16 +36,16 @@ Requires-Dist: PyQt6>=6.7.0
36
36
  ![pylint](https://github.com/Augus1999/pyPDFeditor-GUI/actions/workflows/pylint.yml/badge.svg)
37
37
 
38
38
  ![OS](https://img.shields.io/badge/OS-Win%20|%20Linux%20|%20macOS-blue?color=00b166)
39
- ![python](https://img.shields.io/badge/Python-3.9%20|%203.10-blue.svg?color=dd9b65)
40
- ![PyQt](https://img.shields.io/badge/PyQt-5.15-blue?color=708ddd)
39
+ ![python](https://img.shields.io/badge/Python-≥3.9%20-blue.svg?color=dd9b65)
40
+ ![PyQt](https://img.shields.io/badge/PyQt-6.7-blue?color=708ddd)
41
41
  ![black](https://img.shields.io/badge/code%20style-black-black)
42
42
 
43
- This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11.
43
+ This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11 and Ubuntu on WSL2.
44
44
 
45
45
  ## Welcome 🎃🎉
46
46
 
47
47
  Welcome to use pyPDFeditor-GUI. pyPDFeditor-GUI is a simple cross-platform application, thanks
48
- to [Python](https://www.python.org/), [PyQt5](https://www.riverbankcomputing.com/software/pyqt/)
48
+ to [Python](https://www.python.org/), [PyQt6](https://www.riverbankcomputing.com/software/pyqt/)
49
49
  and [PyMuPDF](https://github.com/pymupdf/PyMuPDF), designed to work on simple PDF handling.
50
50
 
51
51
  I tried my best to make it close to Fluent UI. Icons used can be found [🔗here](https://fluenticons.co/).
@@ -5,16 +5,16 @@
5
5
  ![pylint](https://github.com/Augus1999/pyPDFeditor-GUI/actions/workflows/pylint.yml/badge.svg)
6
6
 
7
7
  ![OS](https://img.shields.io/badge/OS-Win%20|%20Linux%20|%20macOS-blue?color=00b166)
8
- ![python](https://img.shields.io/badge/Python-3.9%20|%203.10-blue.svg?color=dd9b65)
9
- ![PyQt](https://img.shields.io/badge/PyQt-5.15-blue?color=708ddd)
8
+ ![python](https://img.shields.io/badge/Python-≥3.9%20-blue.svg?color=dd9b65)
9
+ ![PyQt](https://img.shields.io/badge/PyQt-6.7-blue?color=708ddd)
10
10
  ![black](https://img.shields.io/badge/code%20style-black-black)
11
11
 
12
- This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11.
12
+ This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11 and Ubuntu on WSL2.
13
13
 
14
14
  ## Welcome 🎃🎉
15
15
 
16
16
  Welcome to use pyPDFeditor-GUI. pyPDFeditor-GUI is a simple cross-platform application, thanks
17
- to [Python](https://www.python.org/), [PyQt5](https://www.riverbankcomputing.com/software/pyqt/)
17
+ to [Python](https://www.python.org/), [PyQt6](https://www.riverbankcomputing.com/software/pyqt/)
18
18
  and [PyMuPDF](https://github.com/pymupdf/PyMuPDF), designed to work on simple PDF handling.
19
19
 
20
20
  I tried my best to make it close to Fluent UI. Icons used can be found [🔗here](https://fluenticons.co/).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyPDFeditor-GUI
3
- Version: 3.0.6
3
+ Version: 3.0.7
4
4
  Summary: A desktop application to edit PDF files.
5
5
  Home-page: https://github.com/Augus1999/pyPDFeditor-GUI/
6
6
  Author: Nianze A. TAO
@@ -36,16 +36,16 @@ Requires-Dist: PyQt6>=6.7.0
36
36
  ![pylint](https://github.com/Augus1999/pyPDFeditor-GUI/actions/workflows/pylint.yml/badge.svg)
37
37
 
38
38
  ![OS](https://img.shields.io/badge/OS-Win%20|%20Linux%20|%20macOS-blue?color=00b166)
39
- ![python](https://img.shields.io/badge/Python-3.9%20|%203.10-blue.svg?color=dd9b65)
40
- ![PyQt](https://img.shields.io/badge/PyQt-5.15-blue?color=708ddd)
39
+ ![python](https://img.shields.io/badge/Python-≥3.9%20-blue.svg?color=dd9b65)
40
+ ![PyQt](https://img.shields.io/badge/PyQt-6.7-blue?color=708ddd)
41
41
  ![black](https://img.shields.io/badge/code%20style-black-black)
42
42
 
43
- This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11.
43
+ This project is based on PyQt5 and PyMuPDF and tested on Windows 10 & 11 and Ubuntu on WSL2.
44
44
 
45
45
  ## Welcome 🎃🎉
46
46
 
47
47
  Welcome to use pyPDFeditor-GUI. pyPDFeditor-GUI is a simple cross-platform application, thanks
48
- to [Python](https://www.python.org/), [PyQt5](https://www.riverbankcomputing.com/software/pyqt/)
48
+ to [Python](https://www.python.org/), [PyQt6](https://www.riverbankcomputing.com/software/pyqt/)
49
49
  and [PyMuPDF](https://github.com/pymupdf/PyMuPDF), designed to work on simple PDF handling.
50
50
 
51
51
  I tried my best to make it close to Fluent UI. Icons used can be found [🔗here](https://fluenticons.co/).
@@ -15,7 +15,7 @@ if not os.path.exists(app_home):
15
15
 
16
16
  __system__ = platform.system()
17
17
  __author__ = "Nianze A. TAO (Omozawa SUENO)"
18
- __version__ = "3.0.6"
18
+ __version__ = "3.0.7"
19
19
  __all__ = ["main", "reset", "remove"]
20
20
 
21
21
 
@@ -4,6 +4,7 @@
4
4
  wrap the whole application to one function
5
5
  """
6
6
  import os
7
+ import sys
7
8
  import json
8
9
  import shutil
9
10
  import getpass
@@ -698,6 +699,7 @@ class FontDialog(FontDialogR):
698
699
  """
699
700
  display the font
700
701
  """
702
+ font_file = self.name_dict[self.combobox.currentText()]
701
703
  doc = fitz.Document()
702
704
  fitz.utils.new_page(doc, -1, 380, 220)
703
705
  r1 = fitz.Rect(10, 10, 370, 210)
@@ -711,8 +713,8 @@ class FontDialog(FontDialogR):
711
713
  color=(0.24, 0.24, 0.24),
712
714
  align=1,
713
715
  fontsize=25,
714
- fontfile=self.name_dict[self.combobox.currentText()],
715
- fontname="ext_0",
716
+ fontfile=None if font_file == "" else font_file,
717
+ fontname="helv" if font_file == "" else "ext_0",
716
718
  )
717
719
  shape.commit()
718
720
  cover = render_pdf_page(page)
@@ -749,7 +751,11 @@ def remove() -> None:
749
751
  """
750
752
  c = input("Are you sure to remove the whole application? n/Y" "\n>>>")
751
753
  if c.lower() == "y":
752
- sp.call("pip uninstall pypdfeditor-gui", shell=True)
754
+ if sys.executable:
755
+ cmd = f"{sys.executable} -m "
756
+ else:
757
+ cmd = ""
758
+ sp.call(f"{cmd}pip uninstall pypdfeditor-gui", shell=True)
753
759
  if os.path.exists(app_home):
754
760
  shutil.rmtree(app_home)
755
761
  print("process finished")
@@ -152,7 +152,7 @@ def add_watermark(
152
152
  font_size: int,
153
153
  font_file: str,
154
154
  opacity: float = 0.5,
155
- position: Tuple[int] = (0, 0),
155
+ position: Tuple[int, int] = (0, 0),
156
156
  ) -> Union[Doc, Document]:
157
157
  """
158
158
  add watermark
@@ -182,8 +182,8 @@ def add_watermark(
182
182
  stroke_opacity=0.5,
183
183
  fill_opacity=opacity,
184
184
  align=1,
185
- fontfile=font_file,
186
- fontname=os.path.basename(font_file),
185
+ fontfile=None if font_file == "" else font_file,
186
+ fontname="helv" if font_file == "" else os.path.basename(font_file),
187
187
  morph=(pos0, Matrix(rotate)),
188
188
  )
189
189
  shape.commit()
@@ -768,17 +768,20 @@ def find_font(font_dirs: List) -> Tuple[dict]:
768
768
  :return: two dictionaries => {font name: font file address} &
769
769
  {font file address: font name}
770
770
  """
771
- name_dict = {}
772
- dir_dict = {}
773
- for font_dir in font_dirs:
774
- for file_name in os.listdir(font_dir):
775
- full_name = os.path.join(font_dir, file_name)
776
- try:
777
- font_name = Font(fontfile=full_name).name
778
- name_dict[font_name] = str(Path(full_name))
779
- dir_dict[str(Path(full_name))] = font_name
780
- except FzErrorLibrary:
781
- pass
771
+ name_dict = {"default": ""}
772
+ dir_dict = {"": "default"}
773
+ try:
774
+ for font_dir in font_dirs:
775
+ for file_name in os.listdir(font_dir):
776
+ full_name = os.path.join(font_dir, file_name)
777
+ try:
778
+ font_name = Font(fontfile=full_name).name
779
+ name_dict[font_name] = str(Path(full_name))
780
+ dir_dict[str(Path(full_name))] = font_name
781
+ except FzErrorLibrary:
782
+ pass
783
+ except FileNotFoundError:
784
+ ...
782
785
  return name_dict, dir_dict
783
786
 
784
787
 
File without changes