edisonneza / jspdf-invoice-template

PDF template created to generate invoices based on props object. Using jsPDF library.

Home Page:https://edisonneza.github.io/jspdf-invoice-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For Loop Dynamic Rendering, Saves Only 10 Times

ephraim888sun opened this issue · comments

Hello, I have an issue where when I loop through an array of items, the output type of "Save" can only download the different pdfs 10 times. So, if I have 20 items in the array, it can only download 10 of them. However, if I have 4 items in the array, it can download all 4 because it's less than 10. Idk if this is an issue with the jspdf save function since when I do OutputType of DataUrlNewWindow, it can open all 20 jsPDFInvoiceTemplate in the browser. I want to be able to use the output type of Save and download all the pdfs in the for loop

Code example:

//Loop through each item and generate PDF for each vendor

array.forEach((item) => {
quoteCounter++

var props = {
  outputType: OutputType.Save,
  returnJsPDFDocObject: true,
  fileName: `Quote #${quoteCounter} ${vendor.slice(0, 3).toUpperCase()}`,
 ...
}
jsPDFInvoiceTemplate(props)

})

Hello,
are u using chrome? Did u try in another browser? Because seems to be a browser restriction rathen than a bug on jspdf library. Take a look at this stackoverflow issue and let me know if it will fix your issue.

https://stackoverflow.com/questions/53560991/automatic-file-downloads-limited-to-10-files-on-chrome-browser

Yeah, thank you for this workaround. It works