SafePDF 1.1.0__tar.gz → 1.1.1__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 (75) hide show
  1. {safepdf-1.1.0/SafePDF.egg-info → safepdf-1.1.1}/PKG-INFO +61 -9
  2. {safepdf-1.1.0 → safepdf-1.1.1}/README.md +60 -8
  3. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/__init__.py +1 -1
  4. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/build_installer.py +1 -1
  5. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/updates.py +4 -6
  6. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/safe_pdf_ui.py +3 -185
  7. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/theme.py +68 -0
  8. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/version.txt +5 -5
  9. {safepdf-1.1.0 → safepdf-1.1.1/SafePDF.egg-info}/PKG-INFO +61 -9
  10. {safepdf-1.1.0 → safepdf-1.1.1}/LICENSE +0 -0
  11. {safepdf-1.1.0 → safepdf-1.1.1}/MANIFEST.in +0 -0
  12. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/back.png +0 -0
  13. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/compress.png +0 -0
  14. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/compression_err.gif +0 -0
  15. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/crown.svg +0 -0
  16. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/extract.png +0 -0
  17. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/icon.ico +0 -0
  18. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/icon.png +0 -0
  19. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/jpg2pdf.png +0 -0
  20. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/merge.png +0 -0
  21. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/next.png +0 -0
  22. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/pdf2jpg.png +0 -0
  23. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/pdf2ocr.png +0 -0
  24. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/pdf2txt.png +0 -0
  25. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/pdf2word.png +0 -0
  26. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/repair.png +0 -0
  27. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/rotate.png +0 -0
  28. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/assets/split.png +0 -0
  29. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ctrl/__init__.py +0 -0
  30. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ctrl/language_manager.py +0 -0
  31. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ctrl/safe_pdf_controller.py +0 -0
  32. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/logger/__init__.py +0 -0
  33. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/logger/logging_config.py +0 -0
  34. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/__init__.py +0 -0
  35. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf2docx.py +0 -0
  36. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf2jpeg.py +0 -0
  37. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_compress.py +0 -0
  38. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_merge.py +0 -0
  39. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_ocr.py +0 -0
  40. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_operations.py +0 -0
  41. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_rotate.py +0 -0
  42. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ops/pdf_split.py +0 -0
  43. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/safe_pdf_app.py +0 -0
  44. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/test/__init__.py +0 -0
  45. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/test/test_compression.py +0 -0
  46. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/test/test_pro_dialog.py +0 -0
  47. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/de/help_content.txt +0 -0
  48. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/de/pro_features.txt +0 -0
  49. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/de/ui.json +0 -0
  50. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/de/welcome_content.txt +0 -0
  51. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/en/help_content.txt +0 -0
  52. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/en/pro_features.txt +0 -0
  53. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/en/ui.json +0 -0
  54. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/en/welcome_content.txt +0 -0
  55. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/tr/help_content.txt +0 -0
  56. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/tr/pro_features.txt +0 -0
  57. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/tr/ui.json +0 -0
  58. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/text/tr/welcome_content.txt +0 -0
  59. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/__init__.py +0 -0
  60. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/common_elements.py +0 -0
  61. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/help_ui.py +0 -0
  62. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/language_elements.py +0 -0
  63. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/operation_settings.py +0 -0
  64. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/settings_ui.py +0 -0
  65. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/tabs_manager.py +0 -0
  66. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF/ui/update_ui.py +0 -0
  67. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF.egg-info/SOURCES.txt +0 -0
  68. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF.egg-info/dependency_links.txt +0 -0
  69. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF.egg-info/entry_points.txt +0 -0
  70. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF.egg-info/requires.txt +0 -0
  71. {safepdf-1.1.0 → safepdf-1.1.1}/SafePDF.egg-info/top_level.txt +0 -0
  72. {safepdf-1.1.0 → safepdf-1.1.1}/pyproject.toml +0 -0
  73. {safepdf-1.1.0 → safepdf-1.1.1}/requirements.txt +0 -0
  74. {safepdf-1.1.0 → safepdf-1.1.1}/setup.cfg +0 -0
  75. {safepdf-1.1.0 → safepdf-1.1.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SafePDF
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A safe PDF manipulation tool
5
5
  Home-page: https://github.com/mcagriaksoy/safepdf
6
6
  Author: Mehmet Cagri Aksoy
@@ -79,10 +79,11 @@ Dynamic: summary
79
79
  **Interface Features:**
80
80
  - Drag & drop file selection
81
81
  - Real-time progress tracking
82
- - Multi-language UI
83
- - Modern, intuitive design
82
+ - Multi-language UI (English, German, Turkish)
83
+ - Light and dark themes
84
+ - Native window frame with a compact, modern layout
84
85
 
85
- ![Screenshot](img/UI_v1.avif)
86
+ ![SafePDF interface](img/UI_v1.avif)
86
87
 
87
88
  ![How to Use](img/HowToUse.gif)
88
89
 
@@ -90,8 +91,10 @@ Dynamic: summary
90
91
 
91
92
  ### Option 1: Download Executable (Recommended)
92
93
  1. Download the latest release from [Releases](https://github.com/mcagriaksoy/SafePDF/releases/)
93
- 2. Extract the ZIP file
94
- 3. Run `SafePDF.exe`
94
+ 2. Run `SafePdf_v<version>_iwin64.exe` to install, or `SafePdf_v<version>_portable_win64.exe` for the portable build
95
+ 3. Start **SafePDF** from the Start menu or the portable executable
96
+
97
+ > Linux and macOS users can install the package from PyPI or run the app from source (see below).
95
98
 
96
99
  ### Option 2: Install from PyPI
97
100
 
@@ -114,12 +117,22 @@ safepdf
114
117
 
115
118
  ### Option 3: Run from Source
116
119
 
120
+ **Requirements:**
121
+ - Python 3.8+ with `venv`
122
+ - pip
123
+ - On Linux, Tk is also required (for Debian/Ubuntu: `sudo apt install python3-tk`)
124
+
117
125
  ```bash
118
126
  # Clone the repository
119
127
  git clone https://github.com/mcagriaksoy/SafePDF.git
120
128
  cd SafePDF
121
129
 
130
+ # Create and activate a virtual environment
131
+ python3 -m venv .venv
132
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
133
+
122
134
  # Install core dependencies
135
+ python -m pip install --upgrade pip
123
136
  pip install -r requirements.txt
124
137
 
125
138
  # Optional extras
@@ -130,6 +143,8 @@ pip install -r requirements.txt
130
143
  python run_safe_pdf.py
131
144
  ```
132
145
 
146
+ > **Troubleshooting:** If you get `ModuleNotFoundError` (for example `No module named 'pypdfium2'`), the system Python is being used instead of the project virtual environment. Activate the venv first (`source .venv/bin/activate`) or run `.venv/bin/python run_safe_pdf.py`. The `safepdf` command installed by `pip`/`pipx` may point to a separate installation, so run the source checkout explicitly when testing local changes.
147
+
133
148
  **OCR note:** OCR uses Tesseract. Install the Python extra with `SafePDF[ocr]` and make sure the Tesseract OCR application is installed on your system as well.
134
149
 
135
150
  ## How to Use
@@ -146,12 +161,17 @@ python run_safe_pdf.py
146
161
  ```
147
162
  SafePDF/
148
163
  ├── SafePDF/
164
+ │ ├── assets/ # Icons and operation graphics
149
165
  │ ├── ctrl/ # Controllers
150
- │ ├── ui/ # User interface
151
- │ ├── ops/ # PDF operations
166
+ │ ├── installer/ # Inno Setup / InstallForge scripts (Windows)
152
167
  │ ├── logger/ # Logging
153
- │ └── text/ # Localization files
168
+ │ ├── ops/ # PDF operations
169
+ │ ├── test/ # Test suite
170
+ │ ├── text/ # Localized UI content
171
+ │ └── ui/ # User interface
154
172
  ├── docs/ # Marketing website (safepdf.de)
173
+ ├── img/ # README screenshots
174
+ ├── scripts/ # CI/release build helpers
155
175
  ├── run_safe_pdf.py # Main launcher
156
176
  └── requirements.txt # Dependencies
157
177
  ```
@@ -168,6 +188,38 @@ python3 -m http.server 8000
168
188
 
169
189
  The homepage and the converter pages are also available in German ([`docs/de/`](docs/de/)) and Turkish ([`docs/tr/`](docs/tr/)). Language switching uses real, static URLs so search engines index each language separately — no client-side machine translation.
170
190
 
191
+ ### Releasing
192
+
193
+ Releases are driven by version tags. The version in [`SafePDF/__init__.py`](SafePDF/__init__.py) (`__version__`) is the single source of truth and **must match the tag**.
194
+
195
+ ```bash
196
+ # 1. Bump __version__ in SafePDF/__init__.py (and SafePDF/version.txt)
197
+ # 2. Commit, then create and push a matching tag
198
+ git tag v1.2.0
199
+ git push origin v1.2.0
200
+ ```
201
+
202
+ Pushing a `v*` tag triggers two GitHub Actions workflows:
203
+
204
+ - **[`release.yml`](.github/workflows/release.yml)** — verifies the tag matches `__version__`, builds the Windows portable executable with PyInstaller, packages the per-user installer with Inno Setup ([`SafePDF/installer/safepdf.iss`](SafePDF/installer/safepdf.iss)), and publishes a GitHub Release with `SafePdf_v<version>_iwin64.exe` and `SafePdf_v<version>_portable_win64.exe`.
205
+ - **[`publish-pypi.yml`](.github/workflows/publish-pypi.yml)** — publishes the sdist and wheel to PyPI (Trusted Publishing), which is how Linux and macOS users get SafePDF via `pip install SafePDF`.
206
+
207
+ Each released executable is also given a signed **build-provenance attestation** (via `actions/attest-build-provenance`). Anyone can verify that a downloaded file was produced by this repository's release workflow:
208
+
209
+ ```bash
210
+ gh attestation verify SafePdf_v1.2.0_iwin64.exe --repo mcagriaksoy/SafePDF
211
+ ```
212
+
213
+ Build the Windows artifacts locally with:
214
+
215
+ ```bash
216
+ pip install -r requirements.txt pyinstaller
217
+ python scripts/build_windows.py # -> SafePDF/dist/SafePdf_v<version>_portable_win64.exe
218
+ # then compile the installer with Inno Setup's ISCC.exe and SafePDF/installer/safepdf.iss
219
+ ```
220
+
221
+ The legacy InstallForge flow (`python SafePDF/build_installer.py`) still works for local Windows builds that use InstallForge.
222
+
171
223
  ### Contributing
172
224
 
173
225
  Contributions are welcome! Please:
@@ -40,10 +40,11 @@
40
40
  **Interface Features:**
41
41
  - Drag & drop file selection
42
42
  - Real-time progress tracking
43
- - Multi-language UI
44
- - Modern, intuitive design
43
+ - Multi-language UI (English, German, Turkish)
44
+ - Light and dark themes
45
+ - Native window frame with a compact, modern layout
45
46
 
46
- ![Screenshot](img/UI_v1.avif)
47
+ ![SafePDF interface](img/UI_v1.avif)
47
48
 
48
49
  ![How to Use](img/HowToUse.gif)
49
50
 
@@ -51,8 +52,10 @@
51
52
 
52
53
  ### Option 1: Download Executable (Recommended)
53
54
  1. Download the latest release from [Releases](https://github.com/mcagriaksoy/SafePDF/releases/)
54
- 2. Extract the ZIP file
55
- 3. Run `SafePDF.exe`
55
+ 2. Run `SafePdf_v<version>_iwin64.exe` to install, or `SafePdf_v<version>_portable_win64.exe` for the portable build
56
+ 3. Start **SafePDF** from the Start menu or the portable executable
57
+
58
+ > Linux and macOS users can install the package from PyPI or run the app from source (see below).
56
59
 
57
60
  ### Option 2: Install from PyPI
58
61
 
@@ -75,12 +78,22 @@ safepdf
75
78
 
76
79
  ### Option 3: Run from Source
77
80
 
81
+ **Requirements:**
82
+ - Python 3.8+ with `venv`
83
+ - pip
84
+ - On Linux, Tk is also required (for Debian/Ubuntu: `sudo apt install python3-tk`)
85
+
78
86
  ```bash
79
87
  # Clone the repository
80
88
  git clone https://github.com/mcagriaksoy/SafePDF.git
81
89
  cd SafePDF
82
90
 
91
+ # Create and activate a virtual environment
92
+ python3 -m venv .venv
93
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
94
+
83
95
  # Install core dependencies
96
+ python -m pip install --upgrade pip
84
97
  pip install -r requirements.txt
85
98
 
86
99
  # Optional extras
@@ -91,6 +104,8 @@ pip install -r requirements.txt
91
104
  python run_safe_pdf.py
92
105
  ```
93
106
 
107
+ > **Troubleshooting:** If you get `ModuleNotFoundError` (for example `No module named 'pypdfium2'`), the system Python is being used instead of the project virtual environment. Activate the venv first (`source .venv/bin/activate`) or run `.venv/bin/python run_safe_pdf.py`. The `safepdf` command installed by `pip`/`pipx` may point to a separate installation, so run the source checkout explicitly when testing local changes.
108
+
94
109
  **OCR note:** OCR uses Tesseract. Install the Python extra with `SafePDF[ocr]` and make sure the Tesseract OCR application is installed on your system as well.
95
110
 
96
111
  ## How to Use
@@ -107,12 +122,17 @@ python run_safe_pdf.py
107
122
  ```
108
123
  SafePDF/
109
124
  ├── SafePDF/
125
+ │ ├── assets/ # Icons and operation graphics
110
126
  │ ├── ctrl/ # Controllers
111
- │ ├── ui/ # User interface
112
- │ ├── ops/ # PDF operations
127
+ │ ├── installer/ # Inno Setup / InstallForge scripts (Windows)
113
128
  │ ├── logger/ # Logging
114
- │ └── text/ # Localization files
129
+ │ ├── ops/ # PDF operations
130
+ │ ├── test/ # Test suite
131
+ │ ├── text/ # Localized UI content
132
+ │ └── ui/ # User interface
115
133
  ├── docs/ # Marketing website (safepdf.de)
134
+ ├── img/ # README screenshots
135
+ ├── scripts/ # CI/release build helpers
116
136
  ├── run_safe_pdf.py # Main launcher
117
137
  └── requirements.txt # Dependencies
118
138
  ```
@@ -129,6 +149,38 @@ python3 -m http.server 8000
129
149
 
130
150
  The homepage and the converter pages are also available in German ([`docs/de/`](docs/de/)) and Turkish ([`docs/tr/`](docs/tr/)). Language switching uses real, static URLs so search engines index each language separately — no client-side machine translation.
131
151
 
152
+ ### Releasing
153
+
154
+ Releases are driven by version tags. The version in [`SafePDF/__init__.py`](SafePDF/__init__.py) (`__version__`) is the single source of truth and **must match the tag**.
155
+
156
+ ```bash
157
+ # 1. Bump __version__ in SafePDF/__init__.py (and SafePDF/version.txt)
158
+ # 2. Commit, then create and push a matching tag
159
+ git tag v1.2.0
160
+ git push origin v1.2.0
161
+ ```
162
+
163
+ Pushing a `v*` tag triggers two GitHub Actions workflows:
164
+
165
+ - **[`release.yml`](.github/workflows/release.yml)** — verifies the tag matches `__version__`, builds the Windows portable executable with PyInstaller, packages the per-user installer with Inno Setup ([`SafePDF/installer/safepdf.iss`](SafePDF/installer/safepdf.iss)), and publishes a GitHub Release with `SafePdf_v<version>_iwin64.exe` and `SafePdf_v<version>_portable_win64.exe`.
166
+ - **[`publish-pypi.yml`](.github/workflows/publish-pypi.yml)** — publishes the sdist and wheel to PyPI (Trusted Publishing), which is how Linux and macOS users get SafePDF via `pip install SafePDF`.
167
+
168
+ Each released executable is also given a signed **build-provenance attestation** (via `actions/attest-build-provenance`). Anyone can verify that a downloaded file was produced by this repository's release workflow:
169
+
170
+ ```bash
171
+ gh attestation verify SafePdf_v1.2.0_iwin64.exe --repo mcagriaksoy/SafePDF
172
+ ```
173
+
174
+ Build the Windows artifacts locally with:
175
+
176
+ ```bash
177
+ pip install -r requirements.txt pyinstaller
178
+ python scripts/build_windows.py # -> SafePDF/dist/SafePdf_v<version>_portable_win64.exe
179
+ # then compile the installer with Inno Setup's ISCC.exe and SafePDF/installer/safepdf.iss
180
+ ```
181
+
182
+ The legacy InstallForge flow (`python SafePDF/build_installer.py`) still works for local Windows builds that use InstallForge.
183
+
132
184
  ### Contributing
133
185
 
134
186
  Contributions are welcome! Please:
@@ -5,6 +5,6 @@ This file makes the `SafePDF` directory a proper Python package so
5
5
  absolute imports like `from SafePDF.ui...` work consistently.
6
6
  """
7
7
 
8
- __version__ = "1.1.0"
8
+ __version__ = "1.1.1"
9
9
 
10
10
  __all__ = []
@@ -11,7 +11,7 @@ def get_version():
11
11
  match = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
12
12
  if match:
13
13
  return match.group(1)
14
- return "1.1.0" # fallback
14
+ return "1.1.1" # fallback
15
15
 
16
16
  def build_executable(version, safe_pdf_dir, dist_dir):
17
17
  portable_name = f"SafePdf_v{version}_portable_win64"
@@ -66,13 +66,11 @@ class SafePDFUpdates:
66
66
  return None
67
67
 
68
68
  def _get_current_version(self):
69
- """Get current application version"""
69
+ """Get the current application version from the SafePDF package."""
70
70
  try:
71
- version_file = Path(__file__).parent.parent / "version.txt"
72
- if version_file.exists():
73
- with open(version_file, "r") as f:
74
- return f.read().strip()
75
- return "0.0.0"
71
+ from SafePDF import __version__
72
+
73
+ return str(__version__)
76
74
  except Exception as e:
77
75
  self.logger.error(f"Error reading version: {e}")
78
76
  return "0.0.0"
@@ -280,7 +280,7 @@ class SafePDFUI:
280
280
 
281
281
  def setup_main_window(self):
282
282
  """Configure the main application window (uses the native window frame)."""
283
- self.root.title("SafePDF - A tool for PDF Manipulation")
283
+ self.root.title("SafePDF™ - A tool for PDF Manipulation")
284
284
 
285
285
  # Set window size based on screen resolution
286
286
  screen_width = self.root.winfo_screenwidth()
@@ -353,9 +353,6 @@ class SafePDFUI:
353
353
 
354
354
  def create_ui_components(self):
355
355
  """Create all UI components"""
356
- # Add modern header
357
- self.create_header()
358
-
359
356
  # Create main card area
360
357
  self.create_main_card()
361
358
 
@@ -380,138 +377,6 @@ class SafePDFUI:
380
377
  # Update UI to reflect loaded pro status
381
378
  self.update_pro_features()
382
379
 
383
- def create_header(self):
384
- """Create a slim, flat application header (brand + plan badge).
385
-
386
- The native window frame provides minimise/maximise/close, so this bar
387
- only carries branding and a clickable plan badge.
388
- """
389
- pal = self._resolve_theme_palette()
390
- self._header_height = 54
391
-
392
- self.header_frame = tk.Frame(self.root, bg=pal["bg_card"], bd=0, highlightthickness=0)
393
- self.header_frame.pack(fill="x", side="top")
394
- self.header_frame.pack_propagate(False)
395
- self.header_frame.configure(height=self._header_height)
396
-
397
- self.header_label = tk.Label(
398
- self.header_frame,
399
- text=self.lang_manager.get("app_title", "SafePDF™"),
400
- font=(CommonElements.FONT, 16, "bold"),
401
- fg=CommonElements.RED_COLOR,
402
- bg=pal["bg_card"],
403
- bd=0,
404
- padx=0,
405
- pady=0,
406
- )
407
- self.header_label.pack(side="left", padx=(18, 10), pady=14)
408
-
409
- self.pro_badge_label = tk.Label(
410
- self.header_frame,
411
- text="",
412
- font=(CommonElements.FONT, 8, "bold"),
413
- bg=pal["badge_free_bg"],
414
- fg="#ffffff",
415
- padx=8,
416
- pady=2,
417
- cursor="hand2",
418
- relief=tk.FLAT,
419
- bd=0,
420
- )
421
- self.pro_badge_label.pack(side="left", pady=18)
422
- self.pro_badge_label.bind("<Button-1>", lambda e: self.update_manager.show_pro_dialog(self))
423
-
424
- # Kept as attributes for backwards-compatible references elsewhere.
425
- self.header_canvas = None
426
- self.minimize_btn = None
427
- self.maximize_btn = None
428
- self.close_btn = None
429
- self._refresh_header_badge()
430
-
431
- def _refresh_header_badge(self):
432
- """Update the brand badge text/colour to match the pro status + theme."""
433
- try:
434
- pal = self._resolve_theme_palette()
435
- is_pro = bool(getattr(self.controller, "is_pro_activated", False))
436
- if getattr(self, "pro_badge_label", None):
437
- self.pro_badge_label.configure(
438
- text=(
439
- self.lang_manager.get("pro_badge_pro", "PRO")
440
- if is_pro
441
- else self.lang_manager.get("pro_badge_free", "FREE")
442
- ),
443
- bg=pal["success"] if is_pro else pal["badge_free_bg"],
444
- fg="#ffffff",
445
- )
446
- except Exception:
447
- logger.debug("Error refreshing header badge", exc_info=True)
448
-
449
- def _interpolate_color(self, start_hex, end_hex, t):
450
- """Blend two hex colors by factor t in [0,1]."""
451
- t = max(0.0, min(1.0, t))
452
- s = start_hex.lstrip("#")
453
- e = end_hex.lstrip("#")
454
- sr, sg, sb = int(s[0:2], 16), int(s[2:4], 16), int(s[4:6], 16)
455
- er, eg, eb = int(e[0:2], 16), int(e[2:4], 16), int(e[4:6], 16)
456
- r = int(sr + (er - sr) * t)
457
- g = int(sg + (eg - sg) * t)
458
- b = int(sb + (eb - sb) * t)
459
- return f"#{r:02x}{g:02x}{b:02x}"
460
-
461
- def _on_header_resize(self, event):
462
- """Redraw header gradient and position header widgets."""
463
- width = max(1, int(event.width))
464
- height = max(1, int(event.height))
465
-
466
- self.header_canvas.config(width=width, height=height)
467
- self.header_canvas.delete("header_gradient")
468
- button_w = 34
469
- gap = 2
470
- right_pad = 2
471
- btn_h = max(1, height - 2)
472
- close_x = width - right_pad - button_w
473
- max_x = close_x - gap - button_w
474
- min_x = max_x - gap - button_w
475
-
476
- left_x = 20
477
- self.header_label.update_idletasks()
478
- title_w = self.header_label.winfo_reqwidth()
479
-
480
- # Gradient starts after title and ends before window control buttons.
481
- gradient_start_x = left_x + title_w + 8
482
- gradient_end_x = max(gradient_start_x + 1, min_x - 4)
483
-
484
- left_flat_color = self._header_gradient_start
485
- right_flat_color = self._header_control_bg
486
-
487
- # Left solid zone
488
- self.header_canvas.create_rectangle(
489
- 0, 0, gradient_start_x, height, fill=left_flat_color, outline="", tags="header_gradient"
490
- )
491
-
492
- # Middle gradient zone
493
- grad_width = max(1, gradient_end_x - gradient_start_x)
494
- for x in range(gradient_start_x, gradient_end_x):
495
- t = (x - gradient_start_x) / max(1, grad_width - 1)
496
- color = self._interpolate_color(self._header_gradient_start, self._header_gradient_end, t)
497
- self.header_canvas.create_line(x, 0, x, height, fill=color, tags="header_gradient")
498
-
499
- # Right solid zone (control button area)
500
- self.header_canvas.create_rectangle(
501
- gradient_end_x, 0, width, height, fill=right_flat_color, outline="", tags="header_gradient"
502
- )
503
- self.header_canvas.tag_lower("header_gradient")
504
-
505
- self.header_label.config(bg=left_flat_color)
506
- self.header_label.place(x=left_x, y=0, height=height)
507
-
508
- badge_x = left_x + title_w + 12
509
- self.pro_badge_label.place(x=badge_x, y=max(2, (height - 22) // 2))
510
-
511
- self.minimize_btn.place(x=min_x, y=1, width=button_w, height=btn_h)
512
- self.maximize_btn.place(x=max_x, y=1, width=button_w, height=btn_h)
513
- self.close_btn.place(x=close_x, y=1, width=button_w, height=btn_h)
514
-
515
380
  def bind_drag_events(self, widget):
516
381
  """Bind drag events to a widget for window dragging"""
517
382
  widget.bind("<Button-1>", self.start_drag)
@@ -538,34 +403,6 @@ class SafePDFUI:
538
403
  self.drag_data["x"] = 0
539
404
  self.drag_data["y"] = 0
540
405
 
541
- def setup_button_hover_effects(self):
542
- """Setup hover effects for window control buttons"""
543
-
544
- def on_minimize_enter(event):
545
- self.minimize_btn.config(bg="#e9d7d7")
546
-
547
- def on_minimize_leave(event):
548
- self.minimize_btn.config(bg=self._header_control_bg)
549
-
550
- def on_maximize_enter(event):
551
- self.maximize_btn.config(bg="#e9d7d7")
552
-
553
- def on_maximize_leave(event):
554
- self.maximize_btn.config(bg=self._header_control_bg)
555
-
556
- def on_close_enter(event):
557
- self.close_btn.config(bg="#c40e2f", fg=CommonElements.BUTTON_TEXT_DARK)
558
-
559
- def on_close_leave(event):
560
- self.close_btn.config(bg=self._header_control_bg, fg="#111827")
561
-
562
- self.minimize_btn.bind("<Enter>", on_minimize_enter)
563
- self.minimize_btn.bind("<Leave>", on_minimize_leave)
564
- self.maximize_btn.bind("<Enter>", on_maximize_enter)
565
- self.maximize_btn.bind("<Leave>", on_maximize_leave)
566
- self.close_btn.bind("<Enter>", on_close_enter)
567
- self.close_btn.bind("<Leave>", on_close_leave)
568
-
569
406
  def minimize_window(self):
570
407
  """Minimize the window by hiding it and creating a taskbar entry"""
571
408
  if not self.is_minimized:
@@ -674,7 +511,7 @@ class SafePDFUI:
674
511
  """Create the main card-like container with rounded appearance"""
675
512
  # Create outer frame for shadow effect
676
513
  shadow_frame = tk.Frame(self.root, bg="#F4F6FB")
677
- shadow_frame.pack(fill="both", expand=True, padx=12, pady=(8, 10))
514
+ shadow_frame.pack(fill="both", expand=True, padx=6, pady=(4, 6))
678
515
 
679
516
  # Create inner card frame with offset for shadow
680
517
  self.card_frame = tk.Frame(
@@ -1756,15 +1593,6 @@ class SafePDFUI:
1756
1593
  logger.debug("Error reconfiguring ttk styles for theme", exc_info=True)
1757
1594
 
1758
1595
  shadow_color = palette["shadow_bg"]
1759
- try:
1760
- if getattr(self, "header_frame", None):
1761
- self.header_frame.configure(bg=palette["bg_card"])
1762
- if getattr(self, "header_label", None):
1763
- self.header_label.configure(bg=palette["bg_card"], fg=CommonElements.RED_COLOR)
1764
- self._refresh_header_badge()
1765
- except Exception:
1766
- logger.debug("Error updating header colors for theme", exc_info=True)
1767
- logger.debug("Error updating header colors for theme", exc_info=True)
1768
1596
 
1769
1597
  try:
1770
1598
  if getattr(self, "card_frame", None):
@@ -1832,16 +1660,6 @@ class SafePDFUI:
1832
1660
  except Exception:
1833
1661
  pass
1834
1662
 
1835
- try:
1836
- if getattr(self, "minimize_btn", None):
1837
- self.minimize_btn.configure(bg=self._header_control_bg, fg="#111827")
1838
- if getattr(self, "maximize_btn", None):
1839
- self.maximize_btn.configure(bg=self._header_control_bg, fg="#111827")
1840
- if getattr(self, "close_btn", None):
1841
- self.close_btn.configure(bg=self._header_control_bg, fg="#111827")
1842
- except Exception:
1843
- pass
1844
-
1845
1663
  def _on_update_frequency_change(self, frequency):
1846
1664
  """Persist update-check frequency when changed from settings UI."""
1847
1665
  try:
@@ -2167,7 +1985,7 @@ class SafePDFUI:
2167
1985
  def create_bottom_controls(self):
2168
1986
  """Create bottom navigation and control buttons"""
2169
1987
  control_frame = ttk.Frame(self.root, style="TFrame")
2170
- control_frame.pack(fill="x", padx=12, pady=(0, 12))
1988
+ control_frame.pack(fill="x", padx=8, pady=(0, 8))
2171
1989
 
2172
1990
  # Center spacer
2173
1991
  center_frame = ttk.Frame(control_frame)
@@ -115,6 +115,70 @@ def palette(theme_name: str) -> dict:
115
115
  return DARK if str(theme_name).strip().lower() == "dark" else LIGHT
116
116
 
117
117
 
118
+ # Keeps the generated underline images alive for the lifetime of the process.
119
+ _TAB_UNDERLINE_IMAGES = None
120
+
121
+
122
+ def _install_tab_underline(style, pal: dict) -> None:
123
+ """Mark the selected tab with a thin accent underline.
124
+
125
+ The stock ``clam`` theme makes the selected tab narrower/shorter than the
126
+ others. Instead of relying on that, we keep every tab the same size and
127
+ draw a small accent-coloured strip along the bottom edge of the selected
128
+ one using a ttk image element (there is no native underline option).
129
+ """
130
+ global _TAB_UNDERLINE_IMAGES
131
+
132
+ element = "SafePDF.Underline.TNotebook.Tab"
133
+ try:
134
+ if _TAB_UNDERLINE_IMAGES is None:
135
+ master = getattr(style, "master", None)
136
+ import tkinter as tk
137
+
138
+ blank = tk.PhotoImage(master=master, width=1, height=3)
139
+ accent = tk.PhotoImage(master=master, width=1, height=3)
140
+ _TAB_UNDERLINE_IMAGES = (blank, accent)
141
+
142
+ blank, accent = _TAB_UNDERLINE_IMAGES
143
+ blank.put(pal["bg_main"], to=(0, 0, 1, 3))
144
+ accent.put(pal["accent"], to=(0, 0, 1, 3))
145
+
146
+ if element not in style.element_names():
147
+ style.element_create(
148
+ element,
149
+ "image",
150
+ blank,
151
+ ("selected", accent),
152
+ ("!selected", blank),
153
+ )
154
+
155
+ style.layout(
156
+ "TNotebook.Tab",
157
+ [
158
+ (
159
+ "Notebook.tab",
160
+ {
161
+ "sticky": "nswe",
162
+ "children": [
163
+ (
164
+ "Notebook.padding",
165
+ {
166
+ "side": "top",
167
+ "sticky": "nswe",
168
+ "children": [("Notebook.label", {"side": "top", "sticky": "nswe"})],
169
+ },
170
+ ),
171
+ (element, {"side": "bottom", "sticky": "ew"}),
172
+ ],
173
+ },
174
+ )
175
+ ],
176
+ )
177
+ except Exception:
178
+ # A custom layout is cosmetic only; never break theming because of it.
179
+ pass
180
+
181
+
118
182
  def apply_ttk_styles(style, pal=None, font_family=None, base_size=None) -> None:
119
183
  """Configure all ttk widget styles from a palette.
120
184
 
@@ -158,7 +222,11 @@ def apply_ttk_styles(style, pal=None, font_family=None, base_size=None) -> None:
158
222
  background=[("selected", pal["tab_selected"]), ("active", pal["highlight"])],
159
223
  foreground=[("selected", accent), ("active", fg_text), ("disabled", muted)],
160
224
  expand=[("selected", (0, 0, 0, 0))],
225
+ # Keep the selected tab the same size as the others (clam shrinks it
226
+ # by default); selection is shown with the accent underline instead.
227
+ padding=[("selected", (16, 9)), ("active", (16, 9))],
161
228
  )
229
+ _install_tab_underline(style, pal)
162
230
 
163
231
  # Containers / text
164
232
  style.configure("TFrame", background=bg_card)
@@ -3,8 +3,8 @@
3
3
  # For use with PyInstaller --version-file option
4
4
  VSVersionInfo(
5
5
  ffi=FixedFileInfo(
6
- filevers=(1, 1, 0, 0),
7
- prodvers=(1, 1, 0, 0),
6
+ filevers=(1, 1, 1, 0),
7
+ prodvers=(1, 1, 1, 0),
8
8
  mask=0x3f,
9
9
  flags=0x0,
10
10
  OS=0x4,
@@ -19,13 +19,13 @@ VSVersionInfo(
19
19
  [
20
20
  StringStruct('CompanyName', 'github.com/mcagriaksoy'),
21
21
  StringStruct('FileDescription', 'SafePDF - A privacy focused PDF Manipulation Tool'),
22
- StringStruct('FileVersion', '1.1.0'),
22
+ StringStruct('FileVersion', '1.1.1'),
23
23
  StringStruct('InternalName', 'SafePDF'),
24
24
  StringStruct('LegalCopyright', 'Copyright (C) 2025- 2027 by mcagriaksoy'),
25
25
  StringStruct('LegalTrademarks', ''),
26
- StringStruct('OriginalFilename', 'SafePdf_v1.1.0_iwin64.exe'),
26
+ StringStruct('OriginalFilename', 'SafePdf_v1.1.1_iwin64.exe'),
27
27
  StringStruct('ProductName', 'SafePDF'),
28
- StringStruct('ProductVersion', '1.1.0'),
28
+ StringStruct('ProductVersion', '1.1.1'),
29
29
  StringStruct('License', 'GPL-V3.0')
30
30
  ])
31
31
  ]),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SafePDF
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A safe PDF manipulation tool
5
5
  Home-page: https://github.com/mcagriaksoy/safepdf
6
6
  Author: Mehmet Cagri Aksoy
@@ -79,10 +79,11 @@ Dynamic: summary
79
79
  **Interface Features:**
80
80
  - Drag & drop file selection
81
81
  - Real-time progress tracking
82
- - Multi-language UI
83
- - Modern, intuitive design
82
+ - Multi-language UI (English, German, Turkish)
83
+ - Light and dark themes
84
+ - Native window frame with a compact, modern layout
84
85
 
85
- ![Screenshot](img/UI_v1.avif)
86
+ ![SafePDF interface](img/UI_v1.avif)
86
87
 
87
88
  ![How to Use](img/HowToUse.gif)
88
89
 
@@ -90,8 +91,10 @@ Dynamic: summary
90
91
 
91
92
  ### Option 1: Download Executable (Recommended)
92
93
  1. Download the latest release from [Releases](https://github.com/mcagriaksoy/SafePDF/releases/)
93
- 2. Extract the ZIP file
94
- 3. Run `SafePDF.exe`
94
+ 2. Run `SafePdf_v<version>_iwin64.exe` to install, or `SafePdf_v<version>_portable_win64.exe` for the portable build
95
+ 3. Start **SafePDF** from the Start menu or the portable executable
96
+
97
+ > Linux and macOS users can install the package from PyPI or run the app from source (see below).
95
98
 
96
99
  ### Option 2: Install from PyPI
97
100
 
@@ -114,12 +117,22 @@ safepdf
114
117
 
115
118
  ### Option 3: Run from Source
116
119
 
120
+ **Requirements:**
121
+ - Python 3.8+ with `venv`
122
+ - pip
123
+ - On Linux, Tk is also required (for Debian/Ubuntu: `sudo apt install python3-tk`)
124
+
117
125
  ```bash
118
126
  # Clone the repository
119
127
  git clone https://github.com/mcagriaksoy/SafePDF.git
120
128
  cd SafePDF
121
129
 
130
+ # Create and activate a virtual environment
131
+ python3 -m venv .venv
132
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
133
+
122
134
  # Install core dependencies
135
+ python -m pip install --upgrade pip
123
136
  pip install -r requirements.txt
124
137
 
125
138
  # Optional extras
@@ -130,6 +143,8 @@ pip install -r requirements.txt
130
143
  python run_safe_pdf.py
131
144
  ```
132
145
 
146
+ > **Troubleshooting:** If you get `ModuleNotFoundError` (for example `No module named 'pypdfium2'`), the system Python is being used instead of the project virtual environment. Activate the venv first (`source .venv/bin/activate`) or run `.venv/bin/python run_safe_pdf.py`. The `safepdf` command installed by `pip`/`pipx` may point to a separate installation, so run the source checkout explicitly when testing local changes.
147
+
133
148
  **OCR note:** OCR uses Tesseract. Install the Python extra with `SafePDF[ocr]` and make sure the Tesseract OCR application is installed on your system as well.
134
149
 
135
150
  ## How to Use
@@ -146,12 +161,17 @@ python run_safe_pdf.py
146
161
  ```
147
162
  SafePDF/
148
163
  ├── SafePDF/
164
+ │ ├── assets/ # Icons and operation graphics
149
165
  │ ├── ctrl/ # Controllers
150
- │ ├── ui/ # User interface
151
- │ ├── ops/ # PDF operations
166
+ │ ├── installer/ # Inno Setup / InstallForge scripts (Windows)
152
167
  │ ├── logger/ # Logging
153
- │ └── text/ # Localization files
168
+ │ ├── ops/ # PDF operations
169
+ │ ├── test/ # Test suite
170
+ │ ├── text/ # Localized UI content
171
+ │ └── ui/ # User interface
154
172
  ├── docs/ # Marketing website (safepdf.de)
173
+ ├── img/ # README screenshots
174
+ ├── scripts/ # CI/release build helpers
155
175
  ├── run_safe_pdf.py # Main launcher
156
176
  └── requirements.txt # Dependencies
157
177
  ```
@@ -168,6 +188,38 @@ python3 -m http.server 8000
168
188
 
169
189
  The homepage and the converter pages are also available in German ([`docs/de/`](docs/de/)) and Turkish ([`docs/tr/`](docs/tr/)). Language switching uses real, static URLs so search engines index each language separately — no client-side machine translation.
170
190
 
191
+ ### Releasing
192
+
193
+ Releases are driven by version tags. The version in [`SafePDF/__init__.py`](SafePDF/__init__.py) (`__version__`) is the single source of truth and **must match the tag**.
194
+
195
+ ```bash
196
+ # 1. Bump __version__ in SafePDF/__init__.py (and SafePDF/version.txt)
197
+ # 2. Commit, then create and push a matching tag
198
+ git tag v1.2.0
199
+ git push origin v1.2.0
200
+ ```
201
+
202
+ Pushing a `v*` tag triggers two GitHub Actions workflows:
203
+
204
+ - **[`release.yml`](.github/workflows/release.yml)** — verifies the tag matches `__version__`, builds the Windows portable executable with PyInstaller, packages the per-user installer with Inno Setup ([`SafePDF/installer/safepdf.iss`](SafePDF/installer/safepdf.iss)), and publishes a GitHub Release with `SafePdf_v<version>_iwin64.exe` and `SafePdf_v<version>_portable_win64.exe`.
205
+ - **[`publish-pypi.yml`](.github/workflows/publish-pypi.yml)** — publishes the sdist and wheel to PyPI (Trusted Publishing), which is how Linux and macOS users get SafePDF via `pip install SafePDF`.
206
+
207
+ Each released executable is also given a signed **build-provenance attestation** (via `actions/attest-build-provenance`). Anyone can verify that a downloaded file was produced by this repository's release workflow:
208
+
209
+ ```bash
210
+ gh attestation verify SafePdf_v1.2.0_iwin64.exe --repo mcagriaksoy/SafePDF
211
+ ```
212
+
213
+ Build the Windows artifacts locally with:
214
+
215
+ ```bash
216
+ pip install -r requirements.txt pyinstaller
217
+ python scripts/build_windows.py # -> SafePDF/dist/SafePdf_v<version>_portable_win64.exe
218
+ # then compile the installer with Inno Setup's ISCC.exe and SafePDF/installer/safepdf.iss
219
+ ```
220
+
221
+ The legacy InstallForge flow (`python SafePDF/build_installer.py`) still works for local Windows builds that use InstallForge.
222
+
171
223
  ### Contributing
172
224
 
173
225
  Contributions are welcome! Please:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes