Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
MDPDF: Markdown to PDF conversion with dynamic footer or header

I'm trying to do a markdown to pdf conversion with mdpdf.

Basic pdf creation works.

My problem is to add a footer (or header) with dynamic content, in this case, a date.

Here's my test.md:

# An MDPDF Test
- convert markdown (.md) to PDF

https://github.com/BlueHatbRit/mdpdf/blob/master/examples/footers/md-file.md

Here's my test_footer.html:

<script>
var dt = new Date();
document.getElementById("datetime").innerHTML = dt.toLocaleDateString();
</script>

<center style="font-size: 10px">
    <p>FOOTER with locale date: <span id="datetime"></span></p>
</center>

I then call in terminal:

mdpdf /Users/felix/test.md  --footer=/Users/felix/test_footer.html

The result is a pdf with the footer text correctly placed, but the actual date in the upper left corner and without localisation.

I saw that mdpdf could use a handlebars (.hbs) file to compile the dynamic content, but have no clue how to do that.

How to get the date into the footer?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda