pdf_pagemerge
Script for layout change of PDF file by merging multiple pages into single page w/o margin.
Requirement
- Python: tested with version 3.11
- pypdf: https://pypi.org/project/pypdf/
- Tested with version 3.16.2
Usage
usage: pdf_pagemerge.py [-h] [-output filename] [-columns n_h] [-lines n_v] [-page-order opt]
[-rotation opt] [-valign opt] [-align opt] [-metainfo opt] [-title text]
input-file [input-file ...]
Merge multiple mages in PDF files w/o gap.
positional arguments:
input-file Input PDF file(s)
optional arguments:
-h, --help show this help message and exit
-output filename Output file
-columns n_h # of columns of merged pages (default = 2)
-lines n_v # of lines of merged pages (default = 1)
-page-order opt Page order (choices=left2right[default], left2bottom, right2left, right2bottom)
-rotation opt Page orientation (choices=none[default], flip, right, left, auto, rauto)
-valign opt Page fitting (choices=resize, none[default], top, bottom, center, fit)
-align opt Page fitting (choices=resize, none[default], right, left, center, fit)
-metainfo opt Meta data for marged file (choices=full[default], none, partial, short)
-title text set title in meta data for marged file (Default: output file name)
Options
-output filename: Filename of the output file. (Default:a.out.pdf)-columns nh,-lines n_v: Output page layout. Each pages in input pdf files will be arranged inton_hcolumns ×n_vlines in a output page. (Default: n_h=2 × n_v=1 ("2up") )-page-order option: Order of the sub-Page layout.left2right: Top line will be filled with sub-pages from left to right at first. Then, next lower lines will be filled with sub-pages.left2bottom: Most left columns will be filled with sub-pages from top to bottom at first. Then, next right columns will be filled with sub-pages.left2top: Most left columns will be filled with sub-pages from bottom to to at first. Then, next right columns will be filled with sub-pages.right2left: Top line will be filled with sub-pages from right to left at first. Then, next lower lines will be filled with sub-pages.right2bottom: Most right columns will be filled with sub-pages from top to bottom at first. Then, next left columns will be filled with sub-pages.right2top: Most right columns will be filled with sub-pages from bottom to top at first. Then, next left columns will be filled with sub-pages.
-rotation option: Sub-Page orientationnone: Each sub-pages will be located with original orientation. (Default)flip: Each sub-pages will be rotated by 180-deg.right: Each sub-pages will be rotated 90-deg counterclockwise.left: Each sub-pages will be rotated 90-deg clockwise.auto: If the first sub-page is in an output pageportrait (landscape), only the landscape (portrait) subpages in a same output page will be rotated by 90-deg counterclockwise.rauto: If the first sub-page in an output page is portrait (landscape), only the landscape (portrait) subpages in a same output page will be rotated by 90-deg clockwise.
-valign opttion: Adjustment of vertical position of sub-pages.none,bottom: Align the bottom of sub-pages for each lines (Default)center: Align the vertical center of sub-pages for each lines (Default)top: Align the top of sub-pages for each lines (Default)resize: Shrink the sub-page size with its height become same as that for the first sub-page in a same output page. If this option is specified with-algin resizeor-algin fit, much smaller scale factor may be applied, but the vertical sub-page spacing is same as the height of the first sub-page in the page.fit: Shrink the sub-page size with its height become same as that for the first sub-page in a same output page. If this option is specified with-algin resizeor-algin fit, much smaller scale factor may be applied, and the vertical sub-page spacing may also become less than the height of the first sub-page in the page.
-align opttion: Adjustment of horizontal position of sub-pages.none,left: Align the right of sub-pages for each columns (Default)center: Align the horizontal center of sub-pages for each columnsright: Align the left of sub-pages for each columnsresize: Shrink the sub-page size with its width become same as that for the first sub-page in a same output page. If this option is specified with-valgin resizeor-valgin fit, much smaller scale factor may be applied, but the horizontal sub-page spacing is same as the width of the first sub-page in the page.fit: Shrink the sub-page size with its width become same as that for the first sub-page in a same output page. If this option is specified with-valgin resizeor-valgin fit, much smaller scale factor may be applied, and the horizontal sub-page spacing may also become less than the width of the first sub-page in the page.
-metainfo options: Meta-data (document info) of output PDF file.full: Meta-data will be generated by concatenating the metadata (document info) of input PDF Files. (default)partial: Meta-data will be partially generated by concatenating the metadata (document info) of input PDF Files.short: Limted metadata ('/Title'、'/Creater', and '/Producer') will be generated shortly.none: No meta-data is generated.(Defalut values ofPyPDF2will be used.)
-title text: Specify the title field of the metadata for output PDF file. (Default is the output file name)
Author
Nanigashi Uji (53845049+nanigashi-uji@users.noreply.github.com) Nanigashi Uji (4423013-nanigashi_uji@users.noreply.gitlab.com)
Metadata
Release files for pdf-pagemerge 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdf_pagemerge-0.0.3.tar.gz | 166.5 kB | Without provenance | Details for pdf_pagemerge-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdf_pagemerge-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pdf_pagemerge-0.0.3-py3-none-any.whl |
Total release size: 175.5 kB
Release files / pdf_pagemerge-0.0.3.tar.gz
| Download URL | pdf_pagemerge-0.0.3.tar.gz |
|---|---|
| Size | 166.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4940398770a5644213004e4cb1cb0d6554c2f95c1982df3b6deb412799f35c32
|
|
BLAKE2b-256 checksum How to use checksums |
a334e0718d934a7e9c874e68a033f37ec2a43d06764461b9446ae11f19cf53c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / pdf_pagemerge-0.0.3-py3-none-any.whl
| Download URL | pdf_pagemerge-0.0.3-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68af2b1fd5660016bbe16dadd77dd78e4a0fbe34e5fe3e94ad523622f1df39f0
|
|
BLAKE2b-256 checksum How to use checksums |
90b17d74cd4b0f997cc1d0b461301bd1dd7ad6337dd06be5be51ef67e2fb3293
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for pdf-pagemerge 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.