About#

HornPenguin Booklet is a pdf modulation program to rearrange, add various markers for printing. Prefixed signature and imposition settings, and paper dimensions are presented.

Installation#

HPBooklet provides 2 types of executable files for Windows, Linux(Ubuntu). All the resources are fully independent to OS, therefore supporting OSX is possible. However, the developer does not have any Mac device, so it will be presented later. If you are OSX user you can build project yourself see below From Source section.

Executable bunldle#

Download executable file from Sourceforge.

Download HornPenguin Booklet

Repository provides two types of program one file version and one directory bundle. The directory bundle version of each OS is presented with compressed file, zip and tgz which are common compressed file format in each OS.

Windows#

default
booklet.exe # one file version
booklet_Windows.zip # one directory bundle

Linux#

default
booklet # one file version
booklet_Linux.tgz # one directory bundle

OSX#

Please build yourself or directly execute from sources. See the below section.

Warning

Python is compatible for major three OSs, however, the implementations of tkinter in those OSs are different in details. For example, there is a iconbitmap issue in Linux environment and basic tkiner Label and Button are not work properly in OSX of color routines. The developer tested and saw those bugs and fixed them with best efforts (tkmacosx module was useful), but there can be some bugs in Linux and Mac environments. Please notice the developer those bugs to fix.

Older version#

The 0.0.1 version was seperated by user interface. The graphic interface version got w suffix in file name.

Windows

default
booklet.exe # command line interface
bookletw.exe # graphic interface

Linux

default
booklet
bookletw

From source#

This section describes the execution and build process with source directory.

Get a project#

You can download the project with git.

default
git clone https://github.com/HornPenguin/Booklet.git # github
git clone https://git.code.sf.net/p/hornpenguinbooklet/code hornpenguinbooklet-code # sourceforge

or download with zipped file from project source repository ..

Directory

  • booklet: Python source codes.

  • dist: Standalone executable files for OSs.

  • documents: Sphinx rst documents

  • images: Miscellaneous images, in working images or original .odg files.

  • resources: Essential resources for program, voice, images, logo, … .

  • test: Temper test directory.

File

  • .readthedocs.yaml: Readthedocs setting file.

  • build.py: Build script for Pyinstaller and Sphinx.

  • Makefile, make.bat: Sphinx build script.

Dependencies#

Install above dependencies with next command.

default
pip install PyPDF2 reportlab Pillow simpleaudio fonttools

For simpleaudio in Ubuntu, it requires compilers, build tools, and prerequisite library, libasound2-dev, to install. If you are using Ubuntu, you can install build-essential from Ubuntu repository and install libasound2-dev with next command.

default
sudo apt install build-essential libasound2-dev

In Mac, they are automatically installed.

Execution with python#

From the root of project directory,

CUI#
default
python ./booklet/main.py --console {INPUT} {OUTPUTPAHT} {options}

See usage for options and basic usages.

GUI#
default
python ./booklet/main.py

Build#

This project uses PyInstaller as a build tool to generate a standalone executable bundle. In the root of the project directory, there is a build.py file. It is a simple python script to initiate the proejct and document build process with pyinstaller and sphinx. Install Pyinstaller, befroe you start to build.

default
pip install pyinstaller

There are prefixed arguments in build.py and you can use additional pyinstaller arguments. See PyInstaller documents.

default
python build.py --onefile # one file bundle
python build.py --onedir # one directory bundle

Build with graphic user interface with splash image.

default
python build.py --onefile --splash=resources\\splash.png

The --onedir option add platform name to its directory name.

If you add arguments with --sphinx option, build.py automatically build project documents with sphinx.

default
python build.py --onedir --sphinx=html

Usage#

Basic#

UI

../_images/basic_ui.png

Select PDF file to modulate#

../_images/select_file001.png

Click the grey button with ... notation on the right of the input box to choose a manuscript. Otherwise, you can type the file path directly to the input box including the file name, but it is not recommended.

../_images/select_file002.png

In this example, we chose test.pdf file. HornPenguin Booklet automatically detects meta data, title, authors, and pages, of the given pdf files. In CUI mode, just type the path of the selected pdf file.

Basic Settings#

Output path and File name#
../_images/output_setting001.png

Output path is a directory path where the output file will be saved, The default value is the path of the original file. You can modify it by clicking the grey button, ..., or directly modify the path string in the input box.

File name is the name of the output file. The default value is {original file name}_HP_BOOKLET.pdf. You can modify it, but be aware that it does not check the existence of the given file. If there is a same file in the output path, it will be overwritten by the new file.

Pages#
../_images/output_setting002.png

Pages is a number of pages per each signatures. When you choose specific number of sheets, additional blank pages will be shown right to selection box. In this case, manuscript file has 32 pages, so it will be 0 for 4, 8, 16, 32 number of sheets. In the list of sheet numbers, you can see some numbers have a subfix f. f indicates fold support numbers. if you select one of those numbers, the fold check will be activated.

Book format#
../_images/output_setting003.png

Book Format is a page dimension of the output file. The default value conserves the original page size.

../_images/help.png ../_images/PaperFormat.png

See dimension(mm) in above Help -> Paper Format reference.

Fold#
../_images/output_setting004.png

Fold option is restricted to some special sheet numbers in Leaves and they are notated {number}f. The default transformation does not rotate pages for the fold. Check this option, if you want to get a direct result file to fold. It is automatically checked when you check imposition option in the advanced tab.

Riffling direction#

Riffling direction is a riffling direction of the output file. The default: right. left is for old Asian, Arabic, and Hebrew manuscripts.

Advanced options#

../_images/advanced_ui.png

Click the above advanced tab to see advanced settings. Basic settings are using prefixed advanced settings. You can modify more detailed options.

Sheet works#

Blank page(s)#
../_images/Blank.png

Blank page(s) option sets the mode of blank page addition. This mode indicates the location where the additional blank pages are added. Supported options are back, front, both. When you choose both option, the additional pages will be distributed equally front and back. If the additional pages are odd, then the back pages will be prior to the front. The default is back.

Page range#
../_images/Page_range001.png

Page range is a range of pages to use in transformation. You can use selected pages of orginal file to generate signature. You can combine independent single pages and several page ranges with comma, ,. Example: 1-20, 23, 25, 40-100. The total pages in page range will be calulated and shown next to input box. Beaware that if the given range string is not vaild (pages must be in right order and must not exceed max page range) , it will deactivate Generate button below. The default is 1-{total pages of original file}.

Let’s see an example, the above image shows the default range of test.pdf, because its total range is from 1 to 32. You can set specific range like below.

../_images/Page_range002.png

See the right of the input box. It was updated by a change of input range.

If the range is not valid, you can see next, that the example box changes its background color to red and Generate` button is deactivated.

../_images/Page_range003.png ../_images/Page_range004.png
Custom format#
../_images/custom_format.png

You can set a custom paper format that is not listed in Paper format table. The front is the width and the back is the height of the format. The default value is the original paper size or predefined paper format in basic options. See paper format reference in Help -> Paper Format popup.

Signature composition#
../_images/sig_compose001.png

You can set a number of inserting per given number of sheets in signature. The number of inserts you can choose will be presented in list box. The default value is 1 and there are different options that make the number of sheets a multiple of 4.

In above case, 32 sheets, if you choose 4, then,

../_images/sig_compose002.png
Imposition#

Pages located in same pages in printing are merged to single page. Single signatures will be composed of two sequential pages in output file. This option activate fold option in basic tab.

Split#

Save the output file with separation by each signature.

Printing markers#

This options add printing markers to output file. Additional

../_images/printing_markers.png
  • Signature proof: Add color proofs to each signatures. Their vertical locations are different by order of signature. You can easily check missing or misordered signatures in combining state.

  • Trim: Add trim markers indicate trim lines.

  • Registration: Add cross registration black markers to left, right, top, bottom side. It color is registration black.

  • CMYK: Add square Cyan, Magenta, Yellow, Key(black) color markers to left side.

Generation#

../_images/generate_button.png

Click Generation button, progress will be run in behind and program will be deactivated during working.

Note

“progress popup windows will appear and ping sound will notice the job finished. “

Update progress bar routine is in being developed to match with modified current structure.

../_images/Progress.png

Utils#

../_images/utils_ui.png

This tab supports miscellaneous utils; note mode, conversion to image, and custom imposition. Note mode is in developing state, it will not work in 0.0.2 version.

This routine is presented for note maker. However, basic, advanced routines don’t repeat the given pdf pages so you need to expand them using addtional program.

This mode expands the given pdf to note type manuscript. For instance, below tutorial shows making process of laboratory note. The template is presented in template directory on project root directory.

Basic usage is just enable the note mode and enter a total number of pages of note. In this tutorial, HP Booklet will generate 200 pages note.

Some notes need page numbering, expecially laboratory note. As like note mode, you can disable or enable the numbering routine. It allows you to set next options.

  • Location: Header/Footer

  • Align: Left/Center/right

  • Count: Even/Odd/Both/Even only/Odd only

The count options may be confuse if you see at first. This represent the counted pages and number indicated pages.

Even: count full pages and indicate it only on even pages. Even(only): count only even pages and indicate it only on even pages.

It will be enough to show an example.

Command line#

Same with gui method, but all those options are passed by argument and it needs --console option for console mode. Without --console option, it will start gui mode.

default
usage: booklet [-h] [--version] [--format-help] [--console] [-i INPUT] [-o OUTPUT] [-n NAME] [--page-range [PAGE_RANGE ...]]
           [--blank-mode {back,front,both}] [--sig-composition SIG_COMPOSITION SIG_COMPOSITION]
           [--riffle-direction {right,left}] [--fold]
           [--format {The default,A3,A4,A5,B3,B4,B5,B6,JIS B3,JIS B4,JIS B5,JIS B6,Letter,Legal,Tabloid,GOV Letter,GOV Legal,ANSI A,ANSI B,ARCH A,ARCH B} | --custom-format CUSTOM_FORMAT CUSTOM_FORMAT]
           [--imposition] [--split] [--trim] [-reg] [--cmyk] [--sigproof [SIGPROOF]] [-y]
           [inputfile] [outputpath]

For example, if we transform the given pdf input.pdf to signature.pdf with 16 sheets signature composed of 4 sheets subsignature, marking signature proof to brown (hexcode = #964B00),

default
booklet --console input.pdf signature.pdf -sig-composition 4 4 --sigproof #964B00

Other programs#

Alternatives of HornPenguin Booklet

Standalone Program

  • BookletCreator : (Windows, OSX), Commercial products. It provides 14 days free trials. Supports 4, 8, … , 128 sheets signatures.

  • PyBooklet : (Windows), Simple clear booklet program. Supports 4 sheet signature. Using PyPDF (not PyPDF2)

  • bookletimposer : (Linux), in developing. Linux version PyBooklet. Using PyPDF2

  • PDFBooklet : (Winows, Linux), Supports general pdf modulation routines of PyPDF2. It provides preview, custom mapping, transformations. It supports sufficiently large routines for imposition, but you needs to calculate page layouts and imposition on a page.

  • Microsoft Word and Adobe Acrobat Reader: (Winows, Mac), They are supporting simple booklet printing (4 sheets).

  • Imposition Wizard : (Windows, OSX), Commercial products.

  • Bookbinder’s Collator: (OSX), Supports OSX only.

  • A-PDF : (Windows), Commercial program.

  • Quite HOT Imposing : (Winows, OSX), Commercial program.

Plugins

Useful programs with HornPenguin Booklet

  • PDFsam Basic: Free open source PDF modulation program.

  • PDFBooklet: It is an alternative of HornPenguin Booklet, but also it can make up for some abcent part of HPBooklet.

  • Scribus: Scribus is an open source desktop publishing software. There was a discussion about imposition routine in Scribus community and those records influenced to this project.

See also

Credits