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

289
Vistas
HTML to pdf: jump to new page when container content overflows

I am using handlebar to generate an HTML file, and then use puppeteer to change it to pdf. Right now I have a handlebars template of structure like this

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Roboto"
    />
    <style>
    ...
      
      .body_container {
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
        max-height: 19.334cm;
        border: 0.25px solid;
        border-color: #b8b8b8;
        font-size: 14px;
      }

    </style>
    
  </head>

  <body>
   
      <div class="body_container">
        ...
      </div>
      <div style="page-break-before: always"></div>
    ...
  </body>
</html>

The page should look like this enter image description here

There're some divs(pink) inside this body container(in black). The amount of content in each div is dynamic, so there is a possibility that it could overflow.

What I hope to do is whenever the body divs have a height exceeding the max height of the body container, it should jump to a new page and make another body container, then write in there.

Is it possible to do so? Any help/hints would be appreciated!

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