Repository navigation
N Down
huzpsb edited this page Oct 25, 2026
·
1 revision
Cut selected pages into n equally sized pages — symmetric tiling for print. The convenience version of Cut.
| n | grid | example |
|---|---|---|
| 2 | 1x2 | A1 → 2×A2 |
| 3 | 1x3 | |
| 4 | 2x2 | A1 → 4×A3 |
| 8 | 2x4 | A1 → 8×A4 |
| 9 | 3x3 | |
| 12 | 3x4 | |
| 16 | 4x4 | A1 → 16×A5 |
pdfcpu2 ndown [-p pageSelection] [description] n inFile outDir [outFile]
<description> — optional margin:, bgcol:, border: (glue area for reassembly).
pdfcpu2 ndown 2 in.pdf outDir # halve every page
pdfcpu2 ndown 4 in.pdf outDir # quarter every page
pdfcpu2 ndown 'margin:1, bgcol:DarkGray, border:on' 4 in.pdf outDir -u cm
cat poster.pdf | pdfcpu2 ndown 4 - /work/tilespackage main
import (
"context"
"github.com/huzpsb/pdfcpu2/pkg/api"
"github.com/huzpsb/pdfcpu2/pkg/pdfcpu/model"
)
func main() {
ctx := context.Background()
conf := model.NewDefaultConfiguration()
cut := &model.Cut{} // defaults; see model.Cut for margin/color options
err := api.NDownFile(ctx, "in.pdf", "./tiles", "", nil, 4, cut, conf)
if err != nil {
panic(err)
}
}Related: Cut (arbitrary cuts), Poster (the inverse — tile a page up).
pdfcpu2 wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers