How to use the jspdf/dist/jspdf.min function in jspdf

To help you get started, we’ve selected a few jspdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taktik / icure-backend / web / icure-ht / app / src / elements / ht-pat / dialogs / ht-pat-invoicing-dialog.html View on Github external
generateJustificatory(){
                const width = 210
                const height = 297

                const center = function (pdf, x, txt, fontSize) {
                    return x - pdf.getStringUnitWidth(txt) * fontSize / pdf.internal.scaleFactor / 2;
                };

                const pdf = new jsPDF('p', 'mm', [width, height]);


                pdf.setFontSize(9);
                pdf.setFont('Arial');
                pdf.text("Numéro d'ordre:"+this.selectedInvoice.invoiceReference, 20, 24)
                pdf.text("DOCUMENT JUSTIFICATIF DE SOINS DE SANTE DESTINE AU PATIENT", 86, 24)
                pdf.text("Patient", 38.5, 31.5)
                pdf.text("Dispensateur de soins", 117, 31.5)
                pdf.text("Identification", 20, 38.5)
                pdf.text("Identification", 77, 38.5)
                pdf.text("Les prestations de santé ont été effectuées pour le\n compte de :", 134, 38.5)
                pdf.text("Nom: "+this.patient.firstName, 20, 45.5)
                pdf.text("Nom: "+this.hcp.firstName, 77, 45.5)
                pdf.text("Nom: ", 135, 45.5)
                pdf.text("Prénom: "+this.patient.lastName, 20, 52)
                pdf.text("Prénom: "+this.hcp.firstName, 77, 52)
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-pat / ht-pat-detail-ctc-detail-panel.js View on Github external
}))).then(rids => {
              const width = 297.576,
                    height = 566.928;

              const center = function (pdf, x, txt, fontSize) {
                  return x - pdf.getStringUnitWidth(txt) * fontSize / pdf.internal.scaleFactor / 2;
              };

              //const pdf = new jsPDF('p', 'pt', [width, height])

              //pdf.addFont('ArialMS', 'Arial', 'normal')
              //pdf.addFont('Times', 'Serif', 'normal')

              const pdf = new jsPDF('p', 'pt', [width, height]);

              splitColumns.forEach((c, idx) => {
                  if (idx) {
                      pdf.addPage();
                  }
                  const element = this.root.querySelector("#barCode");
                  JsBarcode(element, rids[idx].rid, { format: "CODE128A", displayValue: false, height: 75 });
                  var jpegUrl = element.toDataURL("image/jpeg");

                  pdf.addImage(jpegUrl, 'JPEG', 20, 10, 257.576, 57);
                  pdf.setFontSize(7);
                  pdf.setFont('Arial');
                  pdf.text(center(pdf, 148.56, rids[idx].rid, 7), 69, rids[idx].rid);
                  pdf.setFontSize(9);
                  pdf.setFont('Arial');
                  pdf.text(center(pdf, 148.56, "PREUVE DE PRESCRIPTION ÉLECTRONIQUE", 9), 87.5, "PREUVE DE PRESCRIPTION ÉLECTRONIQUE");

jspdf

PDF Document creation from JavaScript

MIT
Latest version published 2 years ago

Package Health Score

79 / 100
Full package analysis