Upgraded from 3.5.1 to 3.9.2, custom PDF's Don't Load

I’ve just upgraded by getting the github version then running composer install. Composer install had a few warnings in case they are of any significance:

  • the lock files is not up to date with the latest changes in composer.json…
  • package guzzle/guzzle is abandoned, you should avoid using it…
  • package chumper/datatable is abandoned, you should avoid using it…
  • package league/url is abandoned, you should avoid using it…
  • package illuminate/teml is abandoned, you should avoid using it…

The main issue is, the custom PDF designs I spent a long time making are now not loading. The default ones do, but I created custom values and also very long terms which I added to the template. Last time Firefox timed out making PDFs so I manually upgraded pdfMake, but I am guessing this is not the problem now.

The developers console says:
Failed to generate PDF: v is undefined

Any ideas? Should I try re-installing using the zip instead?

I’ve pinned it down to this section, specifically the widths - any ideas why this doesn’t work any more?:

{
“style”: “invoiceLineItemsTable”,
“table”: {
“headerRows”: 1,
“widths”: [
“30%”,
“*”,
“15%”
],
“body”: “$invoiceLineItems”
},
“layout”: {
“hLineWidth”: “$notFirst:0.25”,
“vLineWidth”: “$none”,
“hLineColor”: “#e6e6e6”,
“paddingLeft”: “$amount:8”,
“paddingRight”: “$amount:8”,
“paddingTop”: “$amount:4”,
“paddingBottom”: “$amount:4”
}
},

In v3.9 you’re now able to set which columns to show on /settings/invoice_design#product_fields.

Your design specifies that there are three columns (30, * and 15) so you’d need to make sure only three fields are shown in the table (or change back to $invoiceLineItemColumns)

OK to partly answer my own question and save Hillel some time:

The lines:
{
“style”: “invoiceLineItemsTable”,
“table”: {
“headerRows”: 1,
“widths”: [
“30%”,
“*”,
“15%”
],
“body”: “$invoiceLineItems”
},

Need to be replaced by:
{
“style”: “invoiceLineItemsTable”,
“table”: {
“headerRows”: 1,
“widths”: “$invoiceLineItemColumns”,
“body”: “$invoiceLineItems”
},

I’m not sure why, but I guess I was originally trying to hide the qty and item cost fields by hacking the pdf template. I assume the ability to hide those fields using the drop downs are a new feature and perhaps it broke my hack?

So the fix was replacing the text abive in the DPF template, then choosing to hide the item cost and qty fields

Ah our posts crossed Hillel. Thanks.

Are those composer warnings anything to be concerned about before I start using this install?
If they are I can start again but use the zip download instead.

The deprecations I’m aware of and shouldn’t be an issue.

Not sure about “the lock files is not up to date with the latest changes in composer.json”, I imagine that will go away in v4.0.