PDFLaTeX wrapper for Node
npm install node-pdflatex
pdflatex
takes latex source and returns a Promise of Buffer.
import pdflatex from 'node-pdflatex'
const source = `
\\documentclass{article}
\\begin{document}
Hello World!
\\end{document}
`
const pdf = await pdflatex(source)
Adds the -shell-escape
flag during compilation.
pdflatex(latexContent, { shellEscape: true })
Adds paths to TEXINPUTS
env var during compilation.
pdflatex(latexContent, { texInputs: ['../resources/'] })
This package is written in TypeScript.
That means the NPM package comes with type definitions included.
MIT