alanshaw / alanshaw/markdown-pdf

[feature] runningsPath alternative by using a function

Aperta
#201 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.9k
Fork
253
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi, great job.
It will be practical to use a function for placing header and footer, programmatically, out of a file.
Like this :

```
let headerContent = function (pageNum, numPages) {
return "

Header " + pageNum + " / " + numPages + "

"
}

let options = {
cssPath: this.rootPath + "/style.css",
header: {
height: "1cm",
contents: headerContent
}
}

fs.createReadStream(this.rootPath + "/in.md")
.pipe(markdownpdf(options))
.pipe(fs.createWriteStream(this.rootPath + "/out.pdf"))
```

It will be also useful for making custom header and footer be adding variables.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.