Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 20 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ jobs:
- os: windows-latest
python-version: "3.12"
icon: "./media/icons/pdf.ico"
output-name: pdf_merger_windows.exe
output-name: pdf_tools_windows.exe
pyinstaller-options: "--onefile --windowed"
- os: macos-latest
python-version: "3.12"
icon: "./media/icons/pdf.icns"
output-name: pdf_merger_macos
output-name: pdf_tools_macos
pyinstaller-options: "--windowed"
- os: ubuntu-latest
python-version: "3.12"
icon: "./media/icons/pdf.ico"
output-name: pdf_merger_linux
output-name: pdf_tools_linux
pyinstaller-options: "--onefile --windowed"
steps:
- uses: actions/checkout@v3
Expand All @@ -54,12 +54,12 @@ jobs:

- name: Build Executable
run: |
pyinstaller ${{ matrix.pyinstaller-options }} --name "${{ matrix.output-name }}" --icon=${{ matrix.icon }} --add-data "VERSION:." ./src/app.py
pyinstaller ${{ matrix.pyinstaller-options }} --name "${{ matrix.output-name }}" --icon "${{ matrix.icon }}" --add-data "VERSION:." ./src/main.py

- name: List dist Directory (Debugging)
- name: List Directory (Debugging)
shell: bash
run: ls -la dist/

# Windows-specific steps
- name: Install Inno Setup
if: matrix.os == 'windows-latest'
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Create Windows Installer
if: matrix.os == 'windows-latest'
run: |
iscc installers/windows_setup.iss /DMyAppVersion=${{ env.VERSION }}
iscc installers/windows_setup.iss /DMyAppVersion=${{ env.VERSION }} /DMyAppExeName=${{ matrix.output-name }}

# macOS-specific steps
- name: Install create-dmg
Expand All @@ -79,16 +79,16 @@ jobs:
if: matrix.os == 'macos-latest'
run: |
mkdir -p dist/AppBundle
cp -R dist/"${{ matrix.output-name }}".app dist/AppBundle/
cp -R "dist/${{ matrix.output-name }}.app" dist/AppBundle/
create-dmg \
--volname "PDF Merger Installer" \
--volname "PDF Tools Installer" \
--volicon "${{ matrix.icon }}" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--app-drop-link 600 185 \
--icon "${{ matrix.output-name }}.app" 200 190 \
"dist/pdf_merger_macos.dmg" \
"dist/pdf_tools_macos.dmg" \
dist/AppBundle

# Upload artifacts
Expand All @@ -97,21 +97,21 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: windows_installer
path: installers/Output/pdf_merger_windows.exe
path: installers/Output/*.exe

- name: Upload macOS Installer
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: macos_installer
path: dist/pdf_merger_macos.dmg
path: dist/pdf_tools_macos.dmg

- name: Upload Linux Executable
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: linux_executable
path: dist/pdf_merger_linux
path: dist/${{ matrix.output-name }}

release:
needs: build
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Get version
- name: Get Version
id: get-release-version
shell: bash
run: |
Expand All @@ -147,41 +147,15 @@ jobs:

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
files: |
./artifacts/windows/*.exe
./artifacts/macos/pdf_tools_macos.dmg
./artifacts/linux/${{ matrix.output-name }}
tag_name: "v${{ env.VERSION }}"
release_name: "PDF Merger v${{ env.VERSION }}"
name: "PDF Tools v${{ env.VERSION }}"
draft: false
prerelease: false

- name: Upload Windows Installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/windows/pdf_merger_windows.exe
asset_name: pdf_merger_windows.exe
asset_content_type: application/octet-stream

- name: Upload macOS Installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/macos/pdf_merger_macos.dmg
asset_name: pdf_merger_macos.dmg
asset_content_type: application/x-apple-diskimage

- name: Upload Linux Executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/linux/pdf_merger_linux
asset_name: pdf_merger_linux
asset_content_type: application/octet-stream
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ __pycache__/
dist/
*.spec

# Innosetup build folder
*/Output/

# System files
.DS_Store
Thumbs.db
Expand All @@ -21,7 +24,3 @@ env/

# Python package files
*.egg-info/

# TkinterDND cache
tkinterdnd2/

41 changes: 8 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,38 @@
# 🖨️ PDF Merger App 🖨️
# 🖨️ PDF Tools App 🖨️

# Contents

- [📖 Description](#-description)
- [✨ Features](#-features)
- [📦 Installation](#-installation)
- [⚙️ Run from source](#️-run-from-source)
- [💻 Development](#-development)
- [👥 Contributing](#-contributing)

# 📖 Description

💻 **Windows, Linux and Mac compatible.** 💻

The PDF Merger App is a simple, local and cross-platform desktop application that allows you to combine multiple PDF files into a single document. Built with `Tkinter` for GUI and `PyPDF2` for PDF processing, this app currently supports Windows, macOS, and Linux.
The PDF Tools App is a simple, local and cross-platform desktop application that allows you to manipulate PDF files. Built with `Tkinter` for GUI and `PyPDF2` for PDF processing, this app currently supports Windows, macOS, and Linux.

![App Demo](./media/app.png)

# ✨ Features

- **PDF Selection**: Add PDFs and see them in a preview list.
- **File Reordering**: Reorder files before merging.
- **Cross-Platform**: Works on Windows, macOS, and Linux.
Right now, the app supports the following features:

# 📦 Installation

In the [**releases**](https://github.com/P-ict0/pdf-merger-app/releases) tab, you will find the executable for the app. Then you can run them directly.

If you prefer to run from source, continue reading.

# ⚙️ Run from source
- **PDF Merger**: Merge multiple PDF files into a single PDF file.

If you want to run from source:

```bash
# Clone
git clone https://github.com/P-ict0/pdf-merger-app.git
cd pdf-merger-app

# (recommended) Set up a virtual environment
python3 -m venv ./venv
# Activate
source ./venv/bin/activate # For linux (Different for Windows and Mac)

# Requirements and run
pip install --upgrade pip
pip install -r requirements.txt
python src/app.py
```
# 📦 Installation

To build the app into an executable, you can use Pyinstaller
In the [**releases**](https://github.com/P-ict0/pdf-tools-app/releases) tab, you will find the executable for the app. Then you can run them directly.

# 💻 Development

1. **Clone the repository**:

```bash
git clone https://github.com/your-username/pdf-merger-app.git
cd pdf-merger-app
git clone https://github.com/your-username/pdf-tools-app.git
cd pdf-tools-app
```

2. **Install dependencies**: (You might want to use a virtual environment)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
3.0.0
15 changes: 9 additions & 6 deletions installers/windows_setup.iss
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#define MyAppName "PDF Merger"
; Define application constants
#define MyAppName "PDF Tools"
#ifndef MyAppVersion
#define MyAppVersion "1.0.0"
#endif
#define MyAppPublisher "P-ict0"
#define MyAppURL "https://github.com/P-ict0/pdf-merger-app"
#define MyAppExeName "pdf_merger_windows.exe"
#define MyAppURL "https://github.com/P-ict0/pdf-tools-app"
#define MyAppExeName "pdf_tools_windows.exe"

[Setup]
AppId={{98AAE78F-AF6E-44B1-99A1-3C5180C9867A}
AppId={{98AAE78F-AF6E-44B1-99A1-3C5180C9867A}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=yes
DefaultDirName={pf}\{#MyAppName}
DefaultDirName={commonpf}\{#MyAppName}
LicenseFile=..\LICENSE
PrivilegesRequired=admin
OutputBaseFilename=pdf_merger_windows
OutputBaseFilename=pdf_tools_setup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
Expand All @@ -28,6 +29,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "..\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; Include the VERSION file
Source: "..\VERSION"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Expand Down
32 changes: 32 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import sys
import os

# Application metadata
APP_NAME = "PDF Tools"
APP_AUTHOR = "P-ict0"
APP_URL = "https://github.com/P-ict0/pdf-tools-app"
AUTHOR_GITHUB = "https://github.com/P-ict0"


# Version retrieval
def get_base_path() -> str:
"""
Get the base path of the application.
"""
return getattr(sys, "_MEIPASS", os.path.dirname(os.path.abspath(__file__)))


def get_version() -> str:
"""
Get the current version of the local application.
"""
try:
base_path = get_base_path()
version_path = os.path.join(base_path, "VERSION")
with open(version_path, "r") as f:
return f.read().strip()
except Exception:
return "Unknown"


APP_VERSION = get_version()
Loading