Added todo

ref #13
This commit is contained in:
Nicolai Ort 2021-02-08 09:47:28 +01:00
parent 3e2b011d28
commit 75d2ac3c5f
1 changed files with 6 additions and 3 deletions

View File

@ -2,15 +2,18 @@ import axios from 'axios';
import bwipjs from "bwip-js";
import cheerio from "cheerio";
import fs from "fs";
import Handlebars from 'handlebars';
import handlebars from 'handlebars';
import i18next from "i18next";
import Backend from 'i18next-fs-backend';
import mime from "mime-types";
import path from 'path';
import { PDFDocument } from 'pdf-lib';
import promisedHandlebars from "promised-handlebars";
import puppeteer from "puppeteer";
import { Runner } from './models/Runner';
import { RunnerGroup } from './models/RunnerGroup';
const Handlebars = promisedHandlebars(handlebars);
/**
* This class is responsible for all things pdf creation.
* This uses the html templates from src/templates.
@ -68,7 +71,6 @@ export class PdfCreator {
'--use-gl=swiftshader',
'--no-sandbox'
];
await i18next
.use(Backend)
.init({
@ -85,7 +87,8 @@ export class PdfCreator {
);
await Handlebars.registerHelper('--bc',
function (str) {
return "data:image";
//TODO: Fix the async behaviour
return PdfCreator.generateBarcode("code39", str.toString());
}
);
this.browser = await puppeteer.launch({ headless: true, args: minimal_args });