Skip to content

Commit

Permalink
Replace perfectbound logic with sigsize = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
acestronautical committed Feb 9, 2024
1 parent 0ec7df3 commit a25a9e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 147 deletions.
19 changes: 8 additions & 11 deletions src/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { PDFDocument, degrees, rgb } from 'pdf-lib';
import { saveAs } from 'file-saver';
import { Signatures } from './signatures.js';
import { PerfectBound } from './perfectbound.js';
import { WackyImposition } from './wacky_imposition.js';
import { PAGE_LAYOUTS, PAGE_SIZES, LINE_LEN } from './constants.js';
import { updatePageLayoutInfo } from './utils/renderUtils.js';
Expand Down Expand Up @@ -203,17 +202,15 @@ export class Book {

switch (this.format) {
case 'perfect':
this.book = new PerfectBound(
this.orderedpages,
this.duplex,
this.per_sheet,
this.duplexrotate
);
this.rearrangedpages = [this.book.pagelistdetails];
break;
case 'booklet':
// Booklets are a special case where sig size is the total book size
this.sigsize = Math.ceil(this.orderedpages.length / this.per_sheet);
if (this.format == 'perfect') {
// Perfect bind is a special case where sig size is 1
this.sigsize = 1;
this.print_file = 'aggregated';
} else {
// Booklets are a special case where sig size is the total book size
this.sigsize = Math.ceil(this.orderedpages.length / this.per_sheet);
}
/* falls through */
case 'standardsig':
case 'customsig':
Expand Down
59 changes: 0 additions & 59 deletions src/perfectbound.js

This file was deleted.

77 changes: 0 additions & 77 deletions src/perfectbound.test.js

This file was deleted.

0 comments on commit a25a9e9

Please sign in to comment.