Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda