Now that I have my pdf working, I need to make it for all of the assets in the group.
Rather than doing :
if NumberofFiles = 1 then
dim d1 as new MyDynapdfMBS
dim e1 as MyDynapdfMBS
dim file1 as FolderItem
d1.SetLicenseKey "Starter" // For this example you can use a Starter, Lite, Pro or Enterprise License
file1=SaveLocation.Child(Savename1+".pdf")
call d1.CreateNewPDF file1
call d1.Append
call d1.SetUseTransparency(false) // No transparent color
call d1.SetCompressionFilter(d1.kcfFlate) //no Compression
call d1.SetResolution(300) // max resolution
// get picture
dim x1,y1,w1,h1 as integer
dim dw1 as integer = d1.GetPageWidth-100
dim dh1 as integer = d1.GetPageHeight-100
// scale to fit the page size
w1=550
h1=200
x1=50+(dw1-w1)/2
y1=50+(dh1-h1)/2
// add image to pdf
call d1.InsertPicture(p, x1, y1, w1, h1)
call d1.SetFont "Times", d1.kfsNone, 12.0, true, d1.kcp1252
call d1.WriteText 25.0, 530.0, "Tested By: " + TechnicianNameField.text + " Witnessed by: " + WitnessNameField.text
call d1.WriteText 320.0, 530.0, PSIField.text + "PSI"
call d1.WriteText 430.0, 530.0, "Total Time: " + timelabel1.text
call d1.WriteText 25.0, 280.0, TextField50.text +" "+ TextField1.text +" "+ TextField2.text +" "+ TextField62.text
call d1.WriteText 25.0, 260.0, TextField3.text +" "+ TextField4.text
call d1.EndPage
call d1.CloseFile
elseif NumberofFiles = 2 then
// File 2
dim d2 as new MyDynapdfMBS
dim e2 as MyDynapdfMBS
dim file2 as FolderItem
d2.SetLicenseKey "Starter" // For this example you can use a Starter, Lite, Pro or Enterprise License
file2=SaveLocation.Child(Savename2+".pdf")
call d2.CreateNewPDF file2
call d2.Append
call d2.SetUseTransparency(false) // No transparent color
call d2.SetCompressionFilter(d2.kcfFlate) //no Compression
call d2.SetResolution(300) // max resolution
// get picture
dim x2,y2,w2,h2 as integer
dim dw2 as integer = d2.GetPageWidth-100
dim dh2 as integer = d2.GetPageHeight-100
// scale to fit the page size
w2=550
h2=200
x2=50+(dw2-w2)/2
y2=50+(dh2-h2)/2
// add image to pdf
call d2.InsertPicture(p, x2, y2, w2, h2)
call d2.SetFont "Times", d2.kfsNone, 12.0, true, d2.kcp1252
call d2.WriteText 25.0, 530.0, "Tested By: " + TechnicianNameField.text + " Witnessed by: " + WitnessNameField.text
call d2.WriteText 320.0, 530.0, PSIField.text + "PSI"
call d2.WriteText 430.0, 530.0, "Total Time: " + timelabel1.text
call d2.WriteText 25.0, 280.0, TextField51.text +" "+ TextField5.text +" "+ TextField6.text +" "+ TextField63.text
call d2.WriteText 25.0, 260.0, TextField7.text +" "+ TextField8.text
call d2.EndPage
call d2.CloseFile
//file 1
dim d1 as new MyDynapdfMBS
dim e1 as MyDynapdfMBS
dim file1 as FolderItem
d1.SetLicenseKey "Starter" // For this example you can use a Starter, Lite, Pro or Enterprise License
file1=SaveLocation.Child(Savename1+".pdf")
call d1.CreateNewPDF file1
call d1.Append
call d1.SetUseTransparency(false) // No transparent color
call d1.SetCompressionFilter(d1.kcfFlate) //no Compression
call d1.SetResolution(300) // max resolution
// get picture
dim x1,y1,w1,h1 as integer
dim dw1 as integer = d1.GetPageWidth-100
dim dh1 as integer = d1.GetPageHeight-100
// scale to fit the page size
w1=550
h1=200
x1=50+(dw1-w1)/2
y1=50+(dh1-h1)/2
// add image to pdf
call d1.InsertPicture(p, x1, y1, w1, h1)
call d1.SetFont "Times", d1.kfsNone, 12.0, true, d1.kcp1252
call d1.WriteText 25.0, 530.0, "Tested By: " + TechnicianNameField.text + " Witnessed by: " + WitnessNameField.text
call d1.WriteText 320.0, 530.0, PSIField.text + "PSI"
call d1.WriteText 430.0, 530.0, "Total Time: " + timelabel1.text
call d1.WriteText 25.0, 280.0, TextField50.text +" "+ TextField1.text +" "+ TextField2.text +" "+ TextField62.text
call d1.WriteText 25.0, 260.0, TextField3.text +" "+ TextField4.text
call d1.EndPage
call d1.CloseFile
Ect. ect. ect. for 36 assets
what can/should I do?