Invalid arguments passed to jsPDF.text at E.y.private.text.y.text

First time poster, have usually been able to work every problem out myself. I'm at a loss on this one.

I have had almost this exact code snippet work on another project but this time it works at times and others it doesn't

If needed I can post the rest of the project. Or I'll make a sandbox and post the link when the wife goes to bed.

 import jsPDF from 'jspdf'
    const doc = new jsPDF();
  
    const img = '../../assets/AADONOTDELETEused (2).jpg'
  
    var width = doc.internal.pageSize.getWidth()
    var height = doc.internal.pageSize.getHeight()
    doc.addImage(img, 'JPEG', 0, 0, width, height);
  
    // Set the font size and text alignment for form field values
    doc.setFontSize(9);
  
    // Fill in the form field values
    doc.text(formData.name, 42, 50); // Name field
    doc.text(formData.phone, 136, 50); // Phone field
    doc.text(formData.email, 100, 60); // Email field
    doc.text(formData.address, 31, 70); // Address field
    doc.text(formData.year, 12, 92); // Year field
    doc.text(formData.model, 12, 108); // Accessories field
    doc.text(formData.stockNum, 42, 139); // StockNum field
    doc.text(formData.trade, 22, 180); // Trade field
    doc.text(formData.deposit, 31, 163); // Deposit field
    doc.text(formData.options, 15, 211); // Accessories field
    doc.text(formData.msrp, 118, 98); // Accessories field
    doc.text(formData.freight, 188, 85); // Accessories field
    doc.text(formData.commodity, 188, 93); // Accessories field
    doc.text(formData.pdi, 188, 101); // Accessories field
  
    // Save the filled PDF document
    doc.save(("{formData.name}.pdf"));
  };

I have tried taking each of the inputs and test them seperatly, maybe it was the data being passed. Even that does't show me what exactly is wrong because I'll take the name field out and it works or if left in, it works. I'm obviously missing something, I've went over the docs, google, other peoples projects hopefully some stackover wizard could help me out on this.

ERROR Invalid arguments passed to jsPDF.text at E.y.private.text.y.text



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)