Giter VIP home page Giter VIP logo

pdf_merger's Introduction

PDF Merger

App with basic merge functionality of two PDFs, possible selecting whole PDF or custom range.

PDF Merger

Implemented https://github.com/rdbende/Sun-Valley-ttk-theme with slight color modifications in light variant as main theme. There is possibility to change into dark mode by rewriting following line in PDF_merger.py widget.tk.call("set_theme", "light") into widget.tk.call("set_theme", "dark").

Quick start

  1. Install all dependencies in virtual environment pipenv install
  2. Run virtual environment pipenv shell
  3. python3 -m PDF_merger

Create executable

  1. pyinstaller PDFMerger.spec

License

MIT License

pdf_merger's People

Contributors

ppruchnicki avatar

Stargazers

Leszek Emil Buczek avatar Deep Aerial avatar Piotr Więckiewicz avatar Piotr Fic avatar  avatar

Watchers

 avatar

pdf_merger's Issues

_tkinter.TclError on Mac OS

On Mac OS Big Sur error occurs when trying running pipenv run python -m PDF_merger:

DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/deepaerial/Projects/pdf_merger/PDF_merger.py", line 118, in <module>
    root.tk.call("source", os.path.join(dir_path, "theme/sun-valley.tcl"))
_tkinter.TclError: version conflict for package "Tk": have 8.5.9, need 8.6

Pyinstaller build fails for Windows

For building .exe file for Windows few additional packages are required to be installed:

pip install pywin32-ctypes pefile

Also when executing command:

pyinstaller PDFMerger.spec

It fails with following error:

75 WARNING: Assuming this isn't an Anaconda environment or an additional venv/pipenv/... environment manager is being used on top because the conda-meta folder C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\conda-meta doesn't exist.
132 INFO: PyInstaller: 4.5.1
132 INFO: Python: 3.8.8 (conda)
132 INFO: Platform: Windows-10-10.0.19041-SP0
132 INFO: UPX is not available.
146 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Documents\\pdf_merger',
 'C:\\home\\pawel\\pdf_merger']
376 INFO: checking Analysis
376 INFO: Building Analysis because Analysis-00.toc is non existent
376 INFO: Initializing module dependency graph...
391 INFO: Caching module graph hooks...
415 INFO: Analyzing base_library.zip ...
3807 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
3823 INFO: distutils: retargeting to non-venv dir 'c:\\programdata\\anaconda3\\lib'
6819 INFO: Caching module dependency graph...
7054 INFO: running Analysis Analysis-00.toc
7054 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\Scripts\python.exe
7381 INFO: Analyzing PDF_merger.py
8676 INFO: Analyzing hidden import 'PIL._tkinter_finder'
8678 INFO: Processing module hooks...
8679 INFO: Loading module hook 'hook-difflib.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8682 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8684 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8686 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8767 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8770 INFO: Loading module hook 'hook-lib2to3.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8823 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8826 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
8827 INFO: Loading module hook 'hook-PIL.Image.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9165 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9167 INFO: Loading module hook 'hook-PIL.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9177 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9179 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9180 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9181 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9182 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9183 INFO: Loading module hook 'hook-_tkinter.py' from 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks'...
9341 INFO: checking Tree
9341 INFO: Building Tree because Tree-00.toc is non existent
9341 INFO: Building Tree Tree-00.toc
9497 INFO: checking Tree
9497 INFO: Building Tree because Tree-01.toc is non existent
9497 INFO: Building Tree Tree-01.toc
9589 INFO: checking Tree
9589 INFO: Building Tree because Tree-02.toc is non existent
9589 INFO: Building Tree Tree-02.toc
9605 INFO: Looking for ctypes DLLs
9621 INFO: Analyzing run-time hooks ...
9621 INFO: Including run-time hook 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
9634 INFO: Including run-time hook 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
9634 INFO: Including run-time hook 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
9634 INFO: Including run-time hook 'C:\\Users\\User\\.virtualenvs\\pdf_merger-Xpk_HDvU\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
9634 INFO: Looking for dynamic libraries
9865 INFO: Looking for eggs
9865 INFO: Using Python library C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\Scripts\python38.dll
9865 INFO: Found binding redirects:
[]
9865 INFO: Warnings written to C:\Users\User\Documents\pdf_merger\build\PDFMerger\warn-PDFMerger.txt
9913 INFO: Graph cross-reference written to C:\Users\User\Documents\pdf_merger\build\PDFMerger\xref-PDFMerger.html
9950 INFO: Appending 'datas' from .spec
9966 INFO: checking PYZ
9966 INFO: Building PYZ because PYZ-00.toc is non existent
9966 INFO: Building PYZ (ZlibArchive) C:\Users\User\Documents\pdf_merger\build\PDFMerger\PYZ-00.pyz
10624 INFO: Building PYZ (ZlibArchive) C:\Users\User\Documents\pdf_merger\build\PDFMerger\PYZ-00.pyz completed successfully.
10642 INFO: checking PKG
10642 INFO: Building PKG because PKG-00.toc is non existent
10642 INFO: Building PKG (CArchive) PKG-00.pkg
10693 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
10697 INFO: Bootloader C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
10697 INFO: checking EXE
10697 INFO: Building EXE because EXE-00.toc is non existent
10697 INFO: Building EXE from EXE-00.toc
10805 INFO: Copying icons from icons/pdf_color.png
Traceback (most recent call last):
  File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\programdata\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\Scripts\pyinstaller.exe\__main__.py", line 7, in <module  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\__main__.py", line 126, in    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\building\build_main.py", line 815, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\building\build_main.py", line 762, in build
    exec(code, spec_namespace)
  File "PDFMerger.spec", line 23, in <module>
    exe = EXE(pyz,
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\building\api.py", line 524, in __init__
    self.__postinit__()
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\building\datastruct.py", line 159, in __postinit__
    self.assemble()
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\building\api.py", line 620, in assemble
    icon.CopyIcons(tmpnm, self.icon)
  File "C:\Users\User\.virtualenvs\pdf_merger-Xpk_HDvU\lib\site-packages\PyInstaller\utils\win32\icon.py", line 228, in CopyIcons
    raise ValueError(
ValueError: Received icon path 'icons/pdf_color.png' which exists but is not in the correct format. On Windows, only '.ico' images or other '.exe' files may be used as icons. Please convert your '.png' file to a '.ico' then try again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.