function generarPDF(event) {
    event.preventDefault()
    
    
    const str = "HOLA MUNDO"

    var imgData = window.opener.obtenerImagen()
    const doc = new jsPDF()
    doc.setFontSize(10)
    doc.text(100, 10, "PUREFITNESS",'center')
    doc.text(100, 20, "ALBARAN DE ENTREGA",'center')
    doc.text(100, 30, "Cliente:",'center')
    doc.text(100, 40, "Jose María Sanchez",'center')
    doc.text(100, 50, "jmariasanchez@gmail.com",'center')
    doc.text(100, 60, "645741845",'center')
    doc.text(100, 70, "Cadiz",'center')
    doc.text(100, 80, "---------",'center')
    doc.text(100, 90, "MERCANCIA",'center')
    doc.text(100, 100, "2 ud - Airbike Spirit Fitness AB900Plus",'center')
    doc.text(100, 110, "3 ud - Ergómetro Concept2 SkiErg Pared PM5",'center')
    doc.text(100, 120, "10 ud - Disco Bumper Pure Cross CROSS101-05 5kg",'center')
    doc.text(100, 130, "5 ud - Mancuernas de Goma Mets Fitness Moratta PF-9001-10",'center')
    doc.text(100, 140, "3 ud - Barra Olimpica Pure Fitness PURE9400-220 Hard Chrome 220 cm 30mm (D)",'center')
    doc.text(100, 150, "2 ud - Cajón de Foam Pliométrico Pure Fitness PURE8123",'center')
    doc.text(100, 160, "Instalación y montaje",'center')
    doc.text(100, 170, "---------",'center')
    doc.text(100, 200, "Firma del cliente:",'center')    
    doc.addImage(imgData, 'PNG', 10, 240, 75, 40)
    doc.save('pure_albaran.pdf')
    
}