hand-dot/labelmake

[2.0.19] Feature Request: allow basePDF declaration per Schema page (in addition to per Template)

lanterieur opened this issue · 0 comments

Description:

  • Current version 2.0.19 supports a basePDF in its Template
  • When the number of pages can vary, a new basePDF has to be provided with the exact page number and order

Use case 1:

  • Generating a document with two distinct page layouts
  • One of the layouts has to be repeated a variable amount of time
  • Example: A report or article with a front page layout, regular page layout (and more: appendix page layout...)

Use case 2:

  • Generate multiple documents as one
  • Example: Generate a yearly report made of different monthly reports

Request:

  • Add the ability to declare a basePDF per "schema" of the template
const schemas = [
  {
    basePDF:frontPageLayout,
    fieldOne,
    fieldTwo
  },
  {
    basePDF:regularPageLayout,
    fieldThree,
    fieldFour,
    fieldFive
  }
];
const template = {[basePdf,] schemas,  fontName};
labelmake({template, inputs, font})