Skip to content

Conversation

@adamgreenhall
Copy link
Contributor

@adamgreenhall adamgreenhall commented Oct 15, 2024

adds the other 8up orientations
#968

see also: website changes #970

@hhrutter
Copy link
Collaborator

Hi!
Please test this against the latest commit and let me know.
Please don't modify go.mod.
Thank you!

@adamgreenhall
Copy link
Contributor Author

adamgreenhall commented Oct 16, 2024

@hhrutter - re-testing with the latest change now. The new 8ups look good.

I did notice a problem that (I think) is not related to this change, but happened with the addition of nup.Enforce. The basic issue is that for Nup cases where the pages are intended to be oriented differently on the sheet from their original. This includes 2up, and also 8up (which is why I noticed it). See an example of this problem in BookletFromPDFA4_2Up.pdf - it's now preserving the portrait orientation, when it should be oriented landscape on the output (output is still portrait).

You can make it work in these cases by setting enforce:true in the config (see BookletFromPDFLetter_2Up.pdf). But this seems like a non-ideal hack. Ideas?

@hhrutter
Copy link
Collaborator

You are right!
This issue affects all of the following:

BookletFromPDFLedger_8Up.pdf
BookletFromPDFLetter_2Up_perfectbound.pdf
BookletFromPDFLetter_2Up.pdf
BookletFromPDFLetter_2UpWithTrailingBlankPages.pdf
HardbackBookFromPDF.pdf

Looking into it..

@hhrutter
Copy link
Collaborator

Ah, looks like the proper enforce configuration for Booklets slipped thru when I commited this.

enforce is ok, because it enforces a best-fit approach for nupping.
I am aware the naming is mediocre but it does the job.
It's also used by other commands.

Do you want to include this change in your PR?

// DefaultBookletConfig returns the default configuration for a booklet
func DefaultBookletConfig() *model.NUp {
	nup := model.DefaultNUpConfig()
	nup.Margin = 0
	nup.Border = false
	nup.BookletGuides = false
	nup.MultiFolio = false
	nup.FolioSize = 8
	nup.BookletType = model.Booklet
	nup.BookletBinding = model.LongEdge
	nup.Enforce = true
	return nup
}

@adamgreenhall
Copy link
Contributor Author

That makes sense, thanks. Everything looks good now - should be good to go.

@hhrutter hhrutter merged commit 22ebeff into pdfcpu:master Oct 18, 2024
@hhrutter
Copy link
Collaborator

Nice addition.
Thank you so much!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants