Skip to content

Commit

Permalink
Update default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cass-kazumori committed Dec 20, 2023
1 parent 2564370 commit 1aee4a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ export class Book {
this.signatureconfig = configuration.customSigLength;
}

this.page_layout = PAGE_LAYOUTS[configuration.pageLayout];
this.per_sheet = this.page_layout.per_sheet;
const pageLayout = PAGE_LAYOUTS[configuration.pageLayout]

this.page_layout = pageLayout;
this.per_sheet = pageLayout.per_sheet;
this.pack_pages = configuration.wackySpacing === 'wacky_pack';
this.fore_edge_padding_pt = configuration.foreEdgePaddingPt

Expand Down
6 changes: 3 additions & 3 deletions src/book.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ describe("Book model", () => {
const defaultBook = {
inputpdf: null,
password: null,
duplex: false,
duplex: true,
duplexrotate: false,
papersize: [612, 792],
papersize: [595, 842],
flyleaf: false,
spineoffset: false,
format: "standardsig",
sigsize: 8,
sigsize: 4,
customsig: false,
input: null,
currentdoc: null,
Expand Down
6 changes: 3 additions & 3 deletions src/models/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const sourceRotation = urlSafe(z.enum(["none", "90cw", "90ccw", "out_binding", "
/** @type { keyof typeof import("../constants").PAGE_SIZES } */
const availablePaperSizes = Object.keys(PAGE_SIZES);

const paperSize = urlSafe(z.enum(availablePaperSizes)).default("LETTER");
const paperSize = urlSafe(z.enum(availablePaperSizes)).default("A4");

const paperSizeUnit = urlSafe(z.enum(["pt", "in", "cm"])).default("pt");

const printerType = urlSafe(z.enum(["single", "duplex"])).default("single");
const printerType = urlSafe(z.enum(["single", "duplex"])).default("duplex");

const pageLayout = urlSafe(z.enum(["folio", "quarto", "octavo", "sextodecimo"])).default("folio");

Expand Down Expand Up @@ -75,7 +75,7 @@ export const schema = z.object({
topEdgePaddingPt: urlSafe(z.coerce.number()).default(0),
bottomEdgePaddingPt: urlSafe(z.coerce.number()).default(0),
sigFormat,
sigLength: urlSafe(z.coerce.number()).default(8), // Specific to standard
sigLength: urlSafe(z.coerce.number()).default(4), // Specific to standard
customSigLength: urlSafe(commaSeparatedNumberList).default([]), // Specific to custom.
foreEdgePaddingPt: urlSafe(z.coerce.number()).default(0), // specific to wacky small
wackySpacing, // specific to wacky small
Expand Down

0 comments on commit 1aee4a8

Please sign in to comment.