Skip to main content

Tool for encased python script environment.

Project description

pdf_pagemerge

Script for layout change of PDF file by merging multiple pages into single page w/o margin.

Requirement

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 into n_h columns × n_v lines 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 orientation
    • none: 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 resize or -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 resize or -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 columns
    • right: Align the left of sub-pages for each columns
    • resize: 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 resize or -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 resize or -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 of PyPDF2 will 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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_pagemerge-0.0.3.tar.gz (166.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_pagemerge-0.0.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pdf_pagemerge-0.0.3.tar.gz.

File metadata

  • Download URL: pdf_pagemerge-0.0.3.tar.gz
  • Upload date:
  • Size: 166.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pdf_pagemerge-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4940398770a5644213004e4cb1cb0d6554c2f95c1982df3b6deb412799f35c32
MD5 7fd8ca332b410c4490e20173b01b7a8f
BLAKE2b-256 a334e0718d934a7e9c874e68a033f37ec2a43d06764461b9446ae11f19cf53c6

See more details on using hashes here.

File details

Details for the file pdf_pagemerge-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pdf_pagemerge-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pdf_pagemerge-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 68af2b1fd5660016bbe16dadd77dd78e4a0fbe34e5fe3e94ad523622f1df39f0
MD5 ce5b530d84924cbc5f8728310008718a
BLAKE2b-256 90b17d74cd4b0f997cc1d0b461301bd1dd7ad6337dd06be5be51ef67e2fb3293

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page