Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUpFile ignores units setting #739

Closed
maxiride opened this issue Nov 24, 2023 · 4 comments
Closed

NUpFile ignores units setting #739

maxiride opened this issue Nov 24, 2023 · 4 comments
Assignees

Comments

@maxiride
Copy link

PDFCPU version: Golang library github.com/pdfcpu/pdfcpu v0.5.0

Note for readability: the package is imported as pdfapi "github.com/pdfcpu/pdfcpu/pkg/api

Minimal code:

func nup(fIn, fOut string) {
	descNUP := "d: 480 330, orientation: rd, border:off"

	nupConf, err := pdfapi.PDFNUpConfig(2, descNUP)
	if err != nil {
		log.Fatal().Err(err).Msg("ko creazione conf nup")
	}
	// nupConf.InpUnit = types.MILLIMETRES // takes no effect

	c := model.NewDefaultConfiguration()
	c.Unit = types.MILLIMETRES

	err = pdfapi.NUpFile([]string{fIn}, fOut, []string{"1-"}, nupConf, c)
	if err != nil {
		log.Fatal().Err(err).Msg("ko nup pdfcpu")
	}
}

Expected output is a 2up file with the mediabox dimensions set to 480x330mm however the resulting file is 169x116 mm which is the equivalent of 480x330 points.

The unit settings is ignored.

I've also tried to change the nupConf units through nupConf.InpUnit = types.MILLIMETRES with no effect.

@hhrutter
Copy link
Collaborator

True..
gets appended to the issue pipeline.
Thanks for reporting this!

@hhrutter
Copy link
Collaborator

This will be fixed in the upcoming release.
You'll have to pass your configuration into api.PDFNUpConfig using a new parameter.

@maxiride
Copy link
Author

Awesome!

@hhrutter
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants