Small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

Overview

About

Total alerts Language grade: Python Codacy Badge pdfarranger codecov

PDF Arranger is a small python-gtk application, which helps the user to merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface. It is a frontend for pikepdf.

PDF Arranger is a fork of Konstantinos Poulios’s pdfshuffler (see Savannah or Sourceforge). It’s a humble attempt to make the project a bit more active.

screenshot of pdfarranger

Downloads

Microsoft® Windows® Download on Flathub More…

Linux and BSD packages

Linux packages

Customization of keyboard shortcuts

In case you are not satisfied with the default keyboard shortcuts they can be changed. To do so, set enable_custom to true in ~/.config/pdfarranger/config.ini or C:\Users\username\AppData\Roaming\pdfarranger\config.ini and edit other lines.

Install from source

PDF Arranger requires pikepdf >= 1.17.0. pip will automatically install the latest pikepdf if there is no pikepdf installed on the system.

On Debian based distributions

sudo apt-get install python3-pip python3-distutils-extra python3-wheel python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-poppler-0.18 python3-setuptools

On Arch Linux

sudo pacman -S poppler-glib python-distutils-extra python-pip python-gobject gtk3 python-cairo

On Fedora

sudo dnf install poppler-glib python3-distutils-extra python3-pip python3-gobject gtk3 python3-cairo python3-wheel python3-pikepdf python3-img2pdf python3-dateutil

On FreeBSD

sudo pkg install devel/gettext devel/py-gobject3 devel/py-pip devel/py-python-distutils-extra graphics/poppler-glib textproc/intltool textproc/py-pikepdf x11-toolkits/gtk30

Then

pip3 install --user --upgrade https://github.com/pdfarranger/pdfarranger/zipball/main

In addition, PDF Arranger supports image file import if img2pdf is installed.

For developers

git clone https://github.com/pdfarranger/pdfarranger.git
cd pdfarranger
./setup.py build
python3 -m pdfarranger

For Windows see Win32.md.

For translators

  • Download the main branch (see For developers)

  • Run po/genpot.sh. The pot is an automatically generated file and as such should not be in the repository. It is to make life of some translators easier, but it may be often not synchronized with the source code. If you can regenerate it before adding or updating a translation, then do it.

  • Translations are in the following files:

  • For mnemonics accelerators (letters preceded by an underscore) try to follow those rules by priority order:

    • be consistent with other GTK/GNOME software
    • pick a unique letter within that given menu if possible
    • pick the same letter as the original string if available
    • pick a strong letter (e.g. in "Search and replace" rather pick s, r or p than a)
  • If possible test your translation to see it in context (see For developers)

  • You may test different languages with LANG=xx_YY python3 -m pdfarranger

  • Do not include pdfarranger.pot (or any *.po file which was just automatically regenerated) in your pull request. Submit only the translations you actually updated or added.

  • If you don’t want or can’t use the developers tooling (git, po/genpot.sh, python, …) you can edit, download or upload the *.po files from the GitHub web pages.

Comments
  • Installation instructions for FreeBSD

    Installation instructions for FreeBSD

    Hi, do the lines at https://github.com/pdfarranger/pdfarranger#for-developers need something additional?

    I have PDF Arranger installed on my main computer with FreeBSD-CURRENT but testing on a clean machine (helloSystem 0C155) there's this:

    FreeBSD% pwd
    /home/liveuser
    FreeBSD% ls
    Desktop     xorg.conf.d
    FreeBSD% mkdir Documents
    FreeBSD% cd Documents 
    FreeBSD% git clone https://github.com/pdfarranger/pdfarranger.git
    
    Cloning into 'pdfarranger'...
    remote: Enumerating objects: 29, done.
    remote: Counting objects: 100% (29/29), done.
    remote: Compressing objects: 100% (22/22), done.
    remote: Total 2963 (delta 15), reused 11 (delta 7), pack-reused 2934
    Receiving objects: 100% (2963/2963), 1.14 MiB | 1.05 MiB/s, done.
    Resolving deltas: 100% (2065/2065), done.
    FreeBSD% cd pdfarranger
    
    FreeBSD% pip install -e .
    
    Defaulting to user installation because normal site-packages is not writeable
    Obtaining file:///usr/home/liveuser/Documents/pdfarranger
        ERROR: Command errored out with exit status 1:
         command: /usr/local/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/usr/home/liveuser/Documents/pdfarranger/setup.py'"'"'; __file__='"'"'/usr/home/liveuser/Documents/pdfarranger/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zctcsy20            
             cwd: /usr/home/liveuser/Documents/pdfarranger/                                                        
        Complete output (5 lines):                                                                                 
        Traceback (most recent call last):                                                                         
          File "<string>", line 1, in <module>                                                                     
          File "/usr/home/liveuser/Documents/pdfarranger/setup.py", line 24, in <module>                           
            from DistUtilsExtra.command import (                                                                   
        ModuleNotFoundError: No module named 'DistUtilsExtra'                                                      
        ----------------------------------------                                                                   
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    FreeBSD% date ; uname -v
    Sat Jan  9 11:27:37 EST 2021
    FreeBSD 12.1-RELEASE r354233 GENERIC 
    FreeBSD% pkg query '%o %v %R' python3 python37 py37-pip
    lang/python3 3_3 FreeBSD
    lang/python37 3.7.9 FreeBSD
    devel/py-pip 20.2.3 FreeBSD
    FreeBSD% 
    
    opened by grahamperrin 32
  • Poll for new application icon (please contribute)

    Poll for new application icon (please contribute)

    I am an avid user of pdfarranger and was wondering if the project would be interested in updating its application icon? I have made a draft as a suggestion but am happy to modify it further (it is an svg file, but I cannot directly embed that here):

    pdfarranger-icon

    opened by smonsays 31
  • Portable Mode (Windows)

    Portable Mode (Windows)

    As of version 1.7.0 PDF Arranger is not exactly portable as it saves its configuration file (config.ini) in AppData:

    C:\Users\User\AppData\Roaming\pdfarranger\config.ini

    My request- when PDF Arranger starts it should check whether its program folder contains the configuration file (config.ini) and if it is there it should use it (load data from and save data to this configuration file, not using AppData for the configuration file, but the program folder instead).

    This small change would make PDF Arranger truly portable (not writing outside its own folder) and I suppose that this feature will not be hard to be implemented.

    feature PRs welcome 
    opened by smaragdus 30
  • Copy and paste of pages with annotations

    Copy and paste of pages with annotations

    When using PDFarranger to duplicate pages that contain annotations using copy and "paste after", or using "duplicate", I observed the following:

    • Editing the annotation (using Okular) on one page would modify the annotation on the other page (after save & reload)
    • A new annotation created on one page would also appear on the other page (after save & reload)

    Even deleting all annotations (and saving/reloading) does not clear the problem. Any subsequent annotations are still shared by all copies of the page, including new copies created when the pages had no annotations. Even copying such a page into a new file does not clear the problem.

    Duplicating pages without annotations works as expected, i.e. any subsequent annotations only affect the page annotated, not any copies of the page.

    opened by m-holger 29
  • [FIXED] TypeError: only pages can be inserted with libqpdf >= 10.2.0 **AND**  pikepdf < 2.7.0

    [FIXED] TypeError: only pages can be inserted with libqpdf >= 10.2.0 **AND** pikepdf < 2.7.0

    Moderation Edit: in most cases the answer is pip install --upgrade pikepdf Update: 1.7.1 includes a workaround. Upgrade what ever is more convenient for you. /@dreua


    Hi there, I have a problem with the arch software package version of the software. Every time I try to save a modified document it does not do so but instead throws the following error:

    Traceback (most recent call last):
      File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 695, in choose_export_pdf_name
        self.save(mode, file_out)
      File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 157, in wrapper
        func(*args, **kwargs)
      File "/usr/lib/python3.9/site-packages/pdfarranger/pdfarranger.py", line 769, in save
        exporter.export(self.pdfqueue, to_export, file_out, mode, m)
      File "/usr/lib/python3.9/site-packages/pdfarranger/exporter.py", line 168, in export
        pdf_output.pages.append(new_page)
    TypeError: only pages can be inserted
    

    if I use the flatpak version it works fine. Although I would really prefer to use the native arch package

    not our bug 
    opened by sillysimon 26
  • Page gets resized instead of cropped

    Page gets resized instead of cropped

    Describe the bug

    When attempting to crop a page, it gets resized instead.

    To Reproduce

    Steps to reproduce the behavior:

    1. Open a PDF file
    2. Select a page
    3. Open the "Page Format" dialog
    4. Set one of the text fields for cropping to some value, e.g. 60
    5. Confirm, exiting the dialog.

    Expected behavior

    The page gets cropped by specified amount.

    Actual behavior

    Page appears to be small - it is resized or the view is zoomed out, but likely the former. It is not cropped.

    Input files

    test.pdf attached.

    Screenshots

    I can provide a video if needed.

    System and Versions

    • pdfarranger 1.7.1 (.msi package)
    • pikepdf version - not sure, but whatever is packaged with above ^
    • OS = Windows 10

    Additional info

    I also noticed that I cannot resize the page - when attempting to change the value in the text field for scale factor, it gets reset to 0 at first opportunity. Pressing The "+" button next to this field does nothing.

    bug Windows 
    opened by ksetlak 22
  • Create a booklet from multiple pages

    Create a booklet from multiple pages

    Merge and rearrange pages for booklet printing.

    Issue: #438

    The action is available through a new entry in the edit dialog. The generated pages are sized using the source pages (adding widths and using max of height of the two pages) and cannot be sized manually (as this would involve rescaling the source pages).

    Note that

    • I didn't implement tests. If you want I can have a look to it.
    • The behavior of the "cancel" action is not atomic, as I use some other actions (add, delete, insert)
    • Rotated pages are not properly handled, I can also have a look to it if you wan.

    This PR might be a bit premature, however there already is some working code and it doesn't break anything else, so I created it anyway, also because I would be happy to have feedback on my code. It's my very first time sending some (more or less) serious amount of code to an open source project, so sorry if things are a bit clumsy.

    opened by nicos68 21
  • ModuleNotFoundError: No module named 'DistUtilsExtra'

    ModuleNotFoundError: No module named 'DistUtilsExtra'

    On Ubuntu 20.04.3 LTS, I install pdfarranger according to the guidance here using the following steps:

    $ git clone https://github.com/pdfarranger/pdfarranger.git
    $ pyenv shell datasci
    $ python --version
    Python 3.9.1
    $ cd pdfarranger
    $ ./setup.py build
    Traceback (most recent call last):
      File "/home/werner/Public/repo/github.com/pdfarranger/pdfarranger.git/./setup.py", line 24, in <module>
        from DistUtilsExtra.command import (
    ModuleNotFoundError: No module named 'DistUtilsExtra'
    

    Then I try the following but still failed:

    $ pip install distutils-extra
    Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
    ERROR: Could not find a version that satisfies the requirement distutils-extra (from versions: none)
    ERROR: No matching distribution found for distutils-extra
    

    Any hints for fixing this problem? See here for the relevant discussion.

    Regards, HZ

    opened by hongyi-zhao 20
  • pdfarranger forgets file name to save when closing window

    pdfarranger forgets file name to save when closing window

    Describe the bug

    A clear and concise description of what the bug is.

    To Reproduce

    Steps to reproduce the behavior:

    1. open a file pdf
    2. erase one or more pages
    3. close pdfarranger
    4. See error: pdfarranger forgets the name of the file ad uses xdg-desktop-portal-kde when the default file manager is thunar. Even if I use CTRL+S to save the file pdfarranger needs to insert again the same file name.

    Expected behavior

    the previous version was ok

    not our bug bug flatpak 
    opened by lonnic 18
  • Release as a Flatpak package

    Release as a Flatpak package

    Hi,

    It would be great if you could package PDFarranger in a flatpak package (see https://flatpak.org/ for info/documentation). That way non techy users would be able to install the application without having to install separate packages. I also recommend a flatpak package because it is distribution independent, avoids dependency problems and incompatibilities with older/newer Linux distribution versions, and allows sandboxing for additional security.

    Thanks

    opened by thecursedfly 17
  • 1.6.0 almost ready, please test master

    1.6.0 almost ready, please test master

    We now have a lot of (and enough ;-) ) new features in master that needs to be tested. New developments will wait for 1.7.0.

    I plan to release 1.6.0 by mid-July if no annoying bugs are found by then.

    opened by jeromerobert 16
  • Feature: Add option to create Table of Contents

    Feature: Add option to create Table of Contents

    This would be really handy when merging PDFs.

    Having a Table of Contents with a link to the start of the individual PDFs would be a nice to have.

    Something like this

    image

    (This image is from https://www.sejda.com/merge-pdf)

    The names can be derived from the individual pdf files.

    What do you think?

    opened by TheTrio 0
  • Allow user to modify export counter value

    Allow user to modify export counter value

    self.save_file is used for "save all to single file" self.export_file is used for all other "exportmodes"

    @petaflot would you like to test this before merge?

    opened by kbengs 1
  • Don't prompt to save when no changes have been made

    Don't prompt to save when no changes have been made

    Describe the bug

    With a PDF open in PDF Arranger, even if you don't make any changes, you are prompted to save on close

    To Reproduce

    Steps to reproduce the behavior:

    1. Open a pdf
    2. click exit
    3. observe that a save prompt appears

    Expected behavior

    I expect that if I open a PDF document, and I dont make any changes, I should be able to immediately close it without having to save anything. Sometimes I just want to open PDFs to make a export of a selection, and not create an overall project with the PDF..

    System and Versions

    • PDF Arranger version and where you get it (distro package, flatpak, pip, git, download, ...) 1.9.2 (flatpak)
    • pikepdf version and where you get it (distro package, pip, git, ...) 6.2.6 (came with the program)
    • OS name and version (e.g.: Windows 10, Fedora 33, ...) Arch Linux (Gnome 43.2 wayland)
    UX 
    opened by K4LCIFER 3
  • Automatic document numbering on export

    Automatic document numbering on export

    Describe the bug

    following on Multi-page document splitting (feature request) #758

    the counter starts when pdfarranger is started, and just increments every time pages are exported.

    this is typically a problem when:

    • opening a large document
    • exporting a bunch of pages
    • close the document
    • re-open the document at a later time to finish the work
    • exporting pages again : the counter will start at zero again, every time pages are exported the filename needs to be corrected

    Expected behavior

    set the counter to the value specified by the user, overriding the previous value if necessary

    xsane does it right

    feature 
    opened by petaflot 1
  • Wrong text and images location when creating booklet

    Wrong text and images location when creating booklet

    The order of pages seems to be ok but I see strange results on the document linked in 720. The text is overlapped with text from another page: A

    Originally posted by @kbengs in https://github.com/pdfarranger/pdfarranger/issues/721#issuecomment-1250522146

    bug 
    opened by jeromerobert 3
Releases(1.9.2)
Owner
PDF-Arranger developer team
null
Merge multiple PDF files into one.

PDF Merger Merge multiple PDF files into one. Usage % python pdf_merger.py -h usage: pdf_merger.py [-h] [-o OUTPUT] [-f [FILES ...]] optional argumen

Duo Apps 6 Oct 3, 2022
Python script that split PDF files.

Automatic PDF Splitter This script can create new single-page PDFs files from multipaged PDFs. Requirements Python 3.0+ # Debian distros sudo apt-get

Leandro Padula 5 Apr 2, 2022
Split given PDF document into 4 page groups and convert them to booklet format

PUTO: PDF to Booklet converter Split given PDF document into 4 page groups and convert them to booklet format. It creates a PDF like shown below: Fir

null 3 Mar 12, 2022
x-ray is a Python library for finding bad redactions in PDF documents.

A tool to detect whether a PDF has a bad redaction

Free Law Project 73 Dec 19, 2022
WeasyPrint is a smart solution helping web developers to create PDF documents.

WeasyPrint is a smart solution helping web developers to create PDF documents. It turns simple HTML pages into gorgeous statistical reports, invoices, tickets…

Kozea 5.4k Jan 8, 2023
minipdf is a package for creating simple, single-page PDF documents.

minipdf minipdf is a package for creating simple, single-page PDF documents. Installation You can install the development version from GitHub with: #

mikefc 41 Dec 19, 2022
An application which enables the users to perform simple yet intriguing PDF operations

AstutePDF A repository containing the GUI for an application which enables the users to perform simple yet intriguing PDF operations. These include, M

Raghav S 5 Jan 22, 2022
PDFSanitizer - Renders possibly unsafe PDF files and outputs harmless PDF files

PDFSanitizer Renders possibly malicious PDF files and outputs harmless PDF files

null 9 Jan 30, 2022
Convert PDF to AudioBook and Audio Speech to PDF

In this Python project, we will build a GUI-based PDF to Audio and Audio to PDF converter using the Tkinter, OS, path, pyttsx3, SpeechRecognition, PyPDF4, and Pydub libraries and the messagebox module of the Tkinter library.

RISHABH MISHRA 1 Feb 13, 2022
Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza.

tratapdf Trata PDF para torná-lo compatível com PDF/X e com impressoras em escala de cinza. dependências icc-profiles ghostscript visualizador de PDF

null 1 Nov 30, 2021
Compare-pdf - A Flask driven restful API for comparing two PDF files

COMPARE-PDF A Flask driven restful API for comparing two PDF files. Description

Karthikeyan JC 3 Mar 13, 2022
This is PDF Merger Application Developed using Just Python

This is PDF Merger Application Developed using Just Python

Sandeep Kumar Reddy 2 Nov 18, 2021
A bulk pdf generator. This application can generate PDFs in bulk by using just one click.

A bulk html pdf generator. This application can generate PDFs in bulk by using just one click. Screenshots Requirements ?? Your system must have the f

Aman Nirala 3 Apr 23, 2022
Converting Html files to pdf using python script, pdfkit module and wkhtmltopdf.

Html-to-pdf-pdfkit-wkhtml- This repository has code for converting local html files and online html resources into pdf. It is an python script which u

Hemachandran P 1 Nov 9, 2021
Performing the following operations using python on PDF.

Python PDF Handling Tutorial Python is a highly versatile language with a huge set of libraries. It is a high level language with simple syntax. Pytho

Prajwol Lamichhane 131 Dec 16, 2022
pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input

pystitcher pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a mark

Nemo 387 Dec 10, 2022
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Dom 76 Dec 12, 2022
borb is a library for reading, creating and manipulating PDF files in python.

borb is a library for reading, creating and manipulating PDF files in python.

Joris Schellekens 2.9k Jan 1, 2023
This book will take you on an exploratory journey through the PDF format, and the borb Python library.

This book will take you on an exploratory journey through the PDF format, and the borb Python library.

Joris Schellekens 281 Jan 1, 2023