N-up

  • Rearrange all pages of inFile file in order to reduce the number of pages and write the result to outFile.Each new page is composed of multiple original pages in a grid like fashion.The original page size is preserved.

  • Create outFile for a given paper size and arrange imageFiles on pages in a grid like fashion.For a single image file create a single page PDF file and fill the grid with copies of the image.

  • The N-up value n controls the grid layout.

  • Proper rotation based on involved aspect ratios will be applied during the process.

  • Have a look at some examples.

Usage

  1. pdfcpu nup|n-up [-v(erbose)|vv] [-pages pageSelection] [description] outFile n inFile|imageFile...

Flags

flagdescriptionrequired
verboseturn on loggingno
vvverbose loggingno
pagespage selectionno

Arguments

namedescriptionrequireddefault
descriptionconfiguration stringno
outFilePDF output fileyes
nthe N-up valueyes
inFilePDF input fileinFile or imageFile(s)
imageFile…one or more imagesinFile or imageFile(s)

N-up Value

The following table lists all supported values for n and the resulting grid layout with respect to the orientation of the chosen output paper size. See here for a thorough explanation of N-up.

valueportraitlandscape
21x22x1
31x33x1
42x22x2
82x44x2
93x33x3
123x44x3
164x44x4

Description

A configuration string to specify the details of the grid layout.

parameterdescriptionvaluesdefault
ddimensions(width, height) in user units eg. ‘400 200’d: 595 842
fform/paper sizepaper size to be used. Append L or P to enforce landscape/portrait modef: A4
oorientationone of rd, dr, ld, dl for PDF input fileso: rd
belement borderon/off true/falseb: on
melement margininteger >= 0m: 0

Orientation

This is usually associated with the writing direction used in the document to be processed. For PDF input files only

valuedescription
rdright down, default
drdown right
ldleft down
dldown left

Default description

  1. 'f:A4, d:595 842, o:rd, b:on, m:3'
  • You only have to specify any parameter diverging from the default.

  • Only one of dimensions or format is allowed.

Examples

Create out.pdf by applying 4-up to in.pdf. Each page fits 4 original pages of in.pdf into a 2x2 grid:

  1. pdfcpu nup out.pdf 4 in.pdf

N-up  - 图1

The output file will use the page size of the input file unless explicitly declared by a description string like so:

  1. pdfcpu nup 'f:A4' out.pdf 9 in.pdf

N-up  - 图2

nup also accepts a list of image files with the result of rendering all imagesin N-up fashion into a PDF file using the specified paper size (default=A4).Generate out.pdf using A4 Landscape mode where each page fits 4 images onto a 2x2 grid.The grid element border lines are rendered by default as well is the default margin of 3 points applied:

  1. pdfcpu nup 'f:A4L' out.pdf 4 *.jpg *.png *.tif

N-up  - 图3

A single image input file supplied will produce a single page PDF ouput file.In the following example logo.jpg will be 16-up’ed onto out.pdf.Both grid borders and margins are suppressed and the output format is Ledger:

  1. pdfcpu nup 'f:Ledger, b:off, m:0' out.pdf 16 logo.jpg

N-up  - 图4