Skip to content

metadevpro/latex-aas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX as a service

Provides a pdflatex compiler as an endpoint in a container.

Exposes a POST endpoint on container:5050/ to send a TeX file. It will compile it with pdftex and will return the final PDF.

Adapted from https://github.com/comsolid/pdflatex-saas

Endpoints

  • GET /ping will respond { "message" : "pong" } in JSON form.
  • GET /version will respond { "version" : "1.0" }
  • POST /pdf will respond a PDF file or errors.

Commands

Build image

docker build -t latex-aas \
   --build-arg=INSTALL_EXTRA_PACKAGES="texlive-lang-spanish texlive-fonts-recommended" \
   .

Run container

docker run -d --name latex -p "5050:5050" latex-aas

Usage: Compile LaTeX to PDF

curl localhost:5050/pdf --data-binary @demo.tex > demo.pdf

Remove container

docker rm latex --force

Dependencies

  • Ubuntu 24.10
  • pdflatex
  • node 20

License

GNU GENERAL PUBLIC LICENSE, GPL-3.0

(c) Metadev, 2024.