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

1.3K
Vistas
how to add page break on jspdf html

I want to add a page break in jspdf, how to add page break automatically when page will be printed, i use jspdf plugin in vue 3, is it possible to add page break using those plugins?

enter image description here

my code :

<template>
  <div class="parent">
    <div
      class="pdf"
      id="pdf"
      style="
        display: block;
        width: 450px;
        padding: 70px;
        padding-top: 18px;
        padding-left: 16px;
      "
    >
      <div
        v-for="(index, arr) of Array(30)"
        style="
          display: inline-block;
          margin: 15px 0;
          margin-left: 7px;
          text-align: center;
        "
      >
        <div style="font-size: 8.25px">SCS111022021235</div>
        <div style="padding: 4.5px; border: 1px dashed black">
          <img :src="qrCodeUrl" style="width: calc(100px * 0.55)" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import QRCode from "qrcode";
import { jsPDF } from "jspdf";

const qrCodeUrl = ref("");

const doc = new jsPDF("portrait", "px", "a4");

QRCode.toDataURL("asdasd", { margin: 0 }).then(url => {
  qrCodeUrl.value = url;
});
onMounted(() => {
  doc.html(document.getElementById("pdf")!, {
    callback: doc => {
      // doc.save();
      window.open(doc.output("bloburl"), "_blank");
    },
    x: 10,
    y: 10
  });
});
</script>
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