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
Auto Convert PDFs to png files in python

This python tool, which is an application of PyMuPDF module, could auto convert PDFs to png files

Bo-Yu 4 Dec 05, 2021
JoplinPdf2Images - Converts a PDF to images in Joplin and adds it to the specified note as a printout

joplinPdf2Images Converts a PDF to images in Joplin and adds it to the specified

Morten Haahr Kristensen 2 Apr 20, 2022
Convert Lecture Videos to PDF

Convert Lecture Videos to PDF Description Want to go through lecture videos faster without missing any information? Wish you can read the lecture vide

Emilio Kartono 20 Nov 25, 2022
Generate a preview image for a PDF.

PDF ➡️ Preview A simple tool to save me time on Illustrator. Generates a preview image for a PDF file. Useful for sneak peeks to academic publications

David Chuan-En Lin 51 Sep 22, 2022
rst2pdf: Use a text editor. Make a PDF.

rst2pdf: Use a text editor. Make a PDF.

rst2pdf 487 Jan 06, 2023
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
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 01, 2023
Mipdfcompressor - 💕A simple pdf size compressing telegram robot

Pdf Compressor Telegram Bot A simple pdf size compressing telegram robot. Useful for digital documentation. Mandatory Variables API_HASH - Your A

Madhavan Mi 1 Feb 14, 2022
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

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

1.8k Dec 29, 2022
Simple python tool created for downloading PDF.

PDFdownloader Usage Open PDF in full-screen mode Run scan.exe Enter how many pages you want to scan Focus PDF After scanning is done, run merge.exe En

5 Oct 27, 2021
Table automatically extraction from PDF Document

PDF Table Extractor Table automatically extraction from PDF Document Our Icon 📌 Name : PDF Table Extractor 📌 Authors : Minku Koo Jiyong Park 📌 Deve

1 Jan 10, 2022
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
Convert given source code into .pdf with syntax highlighting and more features

Code2pdf 📠 Convert given source code into .pdf with syntax highlighting and more features Build Status Version Downloads Python Demo Installation Bui

Tushar Gautam 343 Jan 05, 2023
Busca no nome e conteúdo de arquivos PDF no diretório e subdiretórios.

PDF Finder Este script auxilia na pesquisa em pastas com inúmeros arquivos PDF. A pesquisa é feita em todos os arquivos do doretório e subdiretórios.

William Pilger 1 Nov 27, 2021
Pdfencrypt is a tool to encrypt/lock PDFs

Pdfencrypt Pdfencrypt is a tool to encrypt/lock PDFs Installation $ apt update $ apt upgrade $ apt install git $ apt install python $ git clone https:

Anontemitayo 5 Nov 28, 2021
Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

Yusuke Shinyama 4.9k Jan 04, 2023
A simple Python script to convert multiple images (well technically also a single image) into a pdf.

PythonImage2PDF A simple Python script to convert multiple images into a single PDF-document. Created basically for only my own needs for converting m

Joona Gynther 1 Jun 28, 2022
Excalibur: A web interface to extract tabular data from PDFs

Excalibur: A web interface to extract tabular data from PDFs Excalibur is a web interface to extract tabular data from PDFs, written in Python 3! It i

1.2k Jan 04, 2023
PDFSanitizer - Renders possibly unsafe PDF files and outputs harmless PDF files

PDFSanitizer Renders possibly malicious PDF files and outputs harmless PDF files

9 Jan 30, 2022
A simple pdf size compressing telegram robot witten in python.

Pdf Compressor Telegram Bot ##About : A simple pdf size compressing telegram robot witten in python. Mostly useful for digital documentation. Deploy t

Renjith Mangal 22 Oct 28, 2022