Put two piles of scans together, and put a document on one sheet - #19
Merged
Conversation
Two verbs a page-manipulation library should have had. Interleave takes pages from each document in turn. It is what a single-sided feeder leaves behind: a stack run through twice comes out as two files, the fronts and the backs, which is one document taken apart. Merging them end to end gives every front then every back; this gives the document. A shorter pile simply runs out, which is what a scanner leaves when the last sheet is single-sided. OnePage stacks every page onto one sheet, one below the other. A page is a unit of paper, not a unit of reading: a receipt, a chat log and a web page cut into A4 are one thing a printer divided, and this puts them back so that what is read scrolls rather than turns. The sheet is as wide as the widest page and as tall as all of them stacked, and narrower pages are centred, because a column that jumps from side to side is harder to read than one that does not. The order is asserted rather than looked at. A PDF's origin is at the bottom, so the FIRST page takes the LARGEST offset and the last sits at zero. Reversed, every page is still there and the document is upside down — which no count of pages would catch. And poppler was asked rather than ourselves. Three pages carrying a mark at a different height each, stacked and rendered: the marks come out at 28%, 48% and 70% of the sheet, against 26.7%, 46.7% and 68.3% computed from where they were put. Parity: BentoPDF's "Alternate & Mix Pages" and "Combine to Single Page". 100% statement coverage, go vet and -race clean, nine cross-compile targets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two verbs a page-manipulation library should have had.
Interleavetakes pages from each document in turn. It is what a single-sided feeder leaves behind: a stack run through twice comes out as two files — the fronts and the backs — which is one document taken apart. Merging them end to end gives every front then every back; this gives the document. A shorter pile simply runs out, which is what a scanner leaves when the last sheet is single-sided.OnePagestacks every page onto one sheet, one below the other. A page is a unit of paper, not a unit of reading: a receipt, a chat log and a web page cut into A4 are one thing a printer divided, and this puts them back so what is read scrolls rather than turns. Narrower pages are centred, because a column that jumps from side to side is harder to read than one that does not.The order is asserted, not looked at
A PDF's origin is at the bottom, so the first page takes the largest offset and the last sits at zero. Reversed, every page is still there and the document is upside down — which no count of pages would catch.
And poppler was asked rather than ourselves
Three pages carrying a mark at a different height each, stacked and rendered:
Parity: BentoPDF's Alternate & Mix Pages and Combine to Single Page.
100% statement coverage,
go vetand-raceclean, nine cross-compile targets.