Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

print spreads with first side left #120

Open
milahu opened this issue May 27, 2022 · 0 comments
Open

print spreads with first side left #120

milahu opened this issue May 27, 2022 · 0 comments

Comments

@milahu
Copy link

milahu commented May 27, 2022

i tried messing with

  • isTwoUp
  • isDoubleSided
  • pages.unshift(spacerPage)
  • padPages

but no luck ...

actual layout

  1
2 3
4

expected layout

1 2
3 4

this is useful for printing pamphlets = single page flyers

workaround: add empty page before first page, then print sheets 2 and 3

      const binderyOptions = {
        content: '#content',
        rules: [
          Bindery.PageBreak({ selector: '.pagebreak', position: 'after' }),

          Bindery.RunningHeader({
            render: (page) => {
              if (page.isEmpty) return "";
              const pageNumber = page.number - 1; // workaround
              const headerTitle = "";
              if (page.isLeft) return `<div class="running-header"><div class="page-number">${ pageNumber }</div>${headerTitle}</div>`;
              if (page.isRight) return `<div class="running-header">${headerTitle}<span class="page-number">${ pageNumber }</span></div>`;
            },
          }),
        ],
        printSetup: {
          // https://bindery.info/docs/#printsetup
          layout: Bindery.Layout.SPREADS, // PAGES SPREADS BOOKLET
          paper: Bindery.Paper.A4_LANDSCAPE, // A5_PORTRAIT A4_LANDSCAPE
          marks: Bindery.Marks.NONE, // NONE CROP BLEED BOTH
          bleed: '-12pt', // workaround: bleed is biased by +12pt -> padding-top: calc(var(--bindery-bleed) + 12pt);
        },
        pageSetup: {
          size: { width: '148mm', height: '209mm' }, // A5. height -1mm to avoid pagebreak https://github.com/evnbr/bindery/issues/109
          margin: { top: '10mm', inner: '20mm', outer: '10mm', bottom: '10mm' },
        },
      };
<div id="content">

<div class="pagebreak"></div>

<p>
  hello world ...
</p>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant