@@ -123,7 +123,7 @@ export class PdfCreator {
|
||||
* @param cards The runner cars you want to generate the cards for.
|
||||
* @param locale The locale used for the cards (default:en)
|
||||
*/
|
||||
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en"): Promise<Buffer> {
|
||||
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat): Promise<Buffer> {
|
||||
if (cards.length > 10) {
|
||||
let pdf_promises = new Array<Promise<Buffer>>();
|
||||
let i, j;
|
||||
@@ -138,7 +138,8 @@ export class PdfCreator {
|
||||
await i18next.changeLanguage(locale);
|
||||
const template_source = fs.readFileSync(`${this.templateDir}/runner_card.html`, 'utf8');
|
||||
const template = Handlebars.compile(template_source);
|
||||
const result = template({ cards, cards_swapped, eventname: "LfK! 2069" })
|
||||
let result = template({ cards, cards_swapped, eventname: "LfK! 2069", codeformat: "qrcode" })
|
||||
result = await awaitAsyncHandlebarHelpers(result);
|
||||
const pdf = await this.renderPdf(result, { format: "A4", landscape: false });
|
||||
return pdf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user