I was asked to update a quote/sales order/invoicing program I wrote in 2017 so that it would print on two pages if necessary. The quotes, etc consist of a heading section, a DynaPDFTableMBS that contains all the items to be sold, and a footer section with links to terms & conditions, product data sheet and installation manuals. The first part was easy, just before the database looped to the next record, I added
if y> 720.0 Then // height of pdf
call tbl.DrawTable(35.0, y, 742.0-y)
call pdf.EndPage
call pdf.Append
tbl.DeleteRows
y= 50
end if
It works fine. At a certain point, one or more of the links at the bottom don’t print so I added this after the tbl.DrawTable command.
if y> 570 Then
call pdf.EndPage
call pdf.Append
y= 50
end if
After adjusting the number of rows to be printed so that the links should be printed at the top of the second page, I found the second page to be blank. But clicking on random blank spots on the second page causes the pdf viewer to display the links. It appears the printing is invisible (or white). If even one row of the table prints on the second page, everything is OK.
Are you using the table’s .havemore property to determine if there is a need for the second page?
The problem only happens after I am finished with the table. I have not been able to find a way to set the text color after searching the docs for TextColor. Perhaps it was not available in the 2016 version of dynaPDFMBS. I see if for things like dynaPDFFieldExMBS but not for the main module.
Download the MBS plugins, duplicate your existing plugins folder, replace the old plugins with the new, and try the new ones in demo mode.
If it works, consider upgrading the plugins.
if it still doesn’t work, then as Christian says, follow your .append with
When I replaced the old DynaPDFMBS plugin with the new one, my CubeSQL plugin stopped working saying SQLSelect was not a valid command recognized by the plugin.
The sales guy who pointed out the problem with needing two pages says the only time he needs that is for orders from distributors and they don’t need the links to the manuals so don’t worry about it if they don’t work properly. Case closed. Thanks to Jeff and Christian for looking into this.
Still use the same version of Xojo but ONLY replace the DynaPDFMBS plugin. That will get rid of that error… The DynaPDF plugin itself does not reference DB stuff.
That is exactly what I did. Restoring the old version of DynaPDFMBS fixed the problem. Thought it was interesting, but not something I am going to spend any time on.