Skip to content

Commit a8a031e

Browse files
committed
Fix #398
1 parent e89570a commit a8a031e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/pdfcpu/process.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ func processGridCommand(conf *pdfcpu.Configuration) {
11011101

11021102
nup := pdfcpu.DefaultNUpConfig()
11031103
nup.InpUnit = conf.Unit
1104+
nup.PageGrid = true
11041105
argInd := 1
11051106

11061107
outFile := flag.Arg(0)

pkg/pdfcpu/nup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import (
3131
)
3232

3333
var (
34-
errInvalidGridID = errors.New("pdfcpu nup: n must be one of 2, 3, 4, 6, 8, 9, 12, 16")
35-
errInvalidGridDims = errors.New("pdfcpu grid: dimensions: m >= 0, n >= 0")
34+
errInvalidNUpVal = errors.New("pdfcpu nup: n must be one of 2, 3, 4, 6, 8, 9, 12, 16")
35+
errInvalidGridDims = errors.New("pdfcpu grid: dimensions must be: m > 0, n > 0")
3636
errInvalidNUpConfig = errors.New("pdfcpu: invalid configuration string")
3737
)
3838

@@ -337,7 +337,7 @@ func ImageGridConfig(rows, cols int, desc string) (*NUp, error) {
337337
// ParseNUpValue parses the NUp value into an internal structure.
338338
func ParseNUpValue(n int, nUp *NUp) error {
339339
if !IntMemberOf(n, nUpValues) {
340-
return errInvalidGridID
340+
return errInvalidNUpVal
341341
}
342342

343343
// The n-Up layout depends on the orientation of the chosen output paper size.
@@ -368,7 +368,7 @@ func ParseNUpGridDefinition(rows, cols int, nUp *NUp) error {
368368
}
369369

370370
n := rows
371-
if m <= 0 {
371+
if n <= 0 {
372372
return errInvalidGridDims
373373
}
374374

0 commit comments

Comments
 (0)