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

586
Vistas
Pdfmake mantiene dos filas juntas en el salto de página cuando se salta la página en la tabla

Para pdfmake, tengo una tabla en la que usa dos filas por registro. Ex: ingrese la descripción de la imagen aquí y cuando la mesa se rompe se rompe por cada fila. Sin embargo, quiero que se rompa después o antes de 2 filas en una tabla, en las que mantienes las dos filas juntas en una página.

En vez de : ingrese la descripción de la imagen aquí

Quiero que las dos filas estén en la misma página. ¿Hay alguna manera de asegurarse de que esto suceda? Intenté usar la función pageBreakBefore, sin embargo, no soy tan intuitivo con ella y no ha habido buenos ejemplos en línea.

 var dd = { content: [ 'The following table has nothing more than a body array', { style: 'tableExample', table: { dontBreakRows:true, // headerRows:1, body: [ [{text:'Col', colSpan:3, fillColor:'grey'}, {},{}], [{text:'Column 1',fillColor:'blue'}, {text:'Column 2',fillColor:'blue'}, {text:'Column 3',fillColor:'blue'}], ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}], ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}] , ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}] , ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}] , ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}] , ['One value goes here', 'Another one here', 'OK?'], [{text:'Description:\n'+'sdfgdhfjsfgvbnfhjfhjfghjgfjgfjfhjfghjgffghjgfasfsjgkfldshgfkld',colSpan:3}] , ], } }, ] }
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Podría definir estas filas como tablas separadas, cada una en una fila en la tabla raíz. De esta manera, las filas no se separarán porque estarán en una fila en la tabla de nivel superior

about 4 years ago · Juan Pablo Isaza Denunciar

0

Puedes manejarlo así:

 pageBreakBefore: function(currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) { //Here you can change the criteria of pageBreak according to your requirement if (currentNode.id === 'myid' && (currentNode.pageNumbers.length != 1 || currentNode.pageNumbers[0] != currentNode.pages)) { return true; } //Here you can change the criteria of pageBreak according to your requirement else if (currentNode.id === 'mySecondid' && currentNode.pageNumbers.length != 1) { return true; } return false; },
about 4 years ago · Juan Pablo Isaza Denunciar
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