Skip to content

Commit 4fcb085

Browse files
authored
Merge pull request #1 from ardafincan/branch2
Branch2
2 parents acc4852 + 58c6de0 commit 4fcb085

5 files changed

Lines changed: 46 additions & 15 deletions

File tree

.DS_Store

-2 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Windows EXE
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch: # manual trigger option
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pyinstaller
25+
pip install -r requirements.txt
26+
27+
- name: Build .exe with PyInstaller
28+
run: |
29+
pyinstaller --onefile --windowed --icon=assets/icon.ico --name="Dekont Sıralayıcı" gui.py
30+
31+
- name: Upload EXE artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: Dekont Sıralayıcı
35+
path: "dist/Dekont Sıralayıcı.exe"
3.52 KB
Binary file not shown.

main_logic.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
1-
import fitz
1+
import pymupdf
22
import re
33
import os
44
import locale
55
import tempfile
6-
from pypdf import PdfMerger, PdfReader, PdfWriter
6+
from pypdf import PdfReader, PdfWriter
77

88
def merge_pdfs(pdf_files):
9-
"""
10-
Merges PDF files from a list of file paths and creates a temporary merged file
11-
12-
Args:
13-
pdf_files: A list of paths to PDF files
14-
15-
Returns:
16-
str: Path to the temporary merged PDF file
17-
"""
18-
merger = PdfMerger()
9+
merge_writer = PdfWriter()
1910

2011
# Use the provided list of file paths directly instead of scanning a folder
2112
for filepath in pdf_files:
22-
merger.append(filepath)
13+
reader = PdfReader(filepath)
14+
for page in reader.pages:
15+
merge_writer.add_page(page)
2316

2417
# Create a temporary file for the merged PDF
2518
with tempfile.NamedTemporaryFile(delete=False, suffix="_merged.pdf") as temp_file:
2619
temp_path = temp_file.name
27-
merger.write(temp_file)
20+
merge_writer.write(temp_file)
2821

2922
# Return the path to the temporary merged file
3023
return temp_path
@@ -41,7 +34,7 @@ def find_name(text):
4134
def page_traverse(pdf_path):
4235
global pages
4336
global_page_number = 0
44-
doc = fitz.open(pdf_path)
37+
doc = pymupdf.open(pdf_path)
4538
pages = []
4639
for page in doc:
4740

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tk
2+
pypdf
3+
pymupdf

0 commit comments

Comments
 (0)