There are a number of royalty-free, but not cheap, products that can do generate PDFs (using PDF "printers" to print DWs). I use the novaPDF SDK, and it works well.
novaPDF has an option to email a PDF after you create it, but I haven't really tested that. And I don't know what "easymail" is so I can't comment on that.
Please Dan, the novaPDF SDK you talked about how did you achieve that because i tried Amyuni PDF converter from my powerbuilder application but encounetr error at this 'PDFPrinter = Mail.PDFDriverInit("Amyuni PDF converter") '. It is returning 0 for PDFPrinter . What could be the problem.
ls_desc = 'C:\STATEMENTS\'+String(ld_investorid)
IF FileExists(ls_desc+ '.pdf' ) THEN
FileDelete(ls_desc+ '.pdf')
End If
ll_save = ids_statement.SaveAs(ls_desc + '.pdf', PDF!, FALSE)
END IF
ls_recipient = TRIM(dw_2.GetItemString(ll_row,'email'))
w_mail_progress.st_1.Text = "Verifying address ..." + ls_recipient
IF NOT f_validate_email(ls_recipient) THEN
w_mail_progress.lb_1.AddItem(String(ll_row)+ ": Failed Verification! -> "+ ls_recipient )
ELSE
w_mail_progress.st_1.Text = "Sending Mail to -> " + ls_recipient
mail.AddRecipient(ls_fullname,ls_recipient,1)
mail.Subject = ls_subject
mail.BodyText = ls_msg
IF Mail.SendMail("ls_recipient", "", "", "Test","A PDF has been attached","ls_desc;FirstFile.PDF",1) = 0 THEN
w_mail_progress.lb_1.AddItem(String(ll_row)+ ": Successfully sent! -> "+ ls_recipient )
li_count = li_count + 1
ELSE
w_mail_progress.lb_1.AddItem(String(ll_row)+ ":Error Sending message! -> "+ ls_recipient )
END IF
END IF
I did try Amyuni as well. I think I got it to work, but I preferred novaPDF for some reasons. Either it was faster, or the PDFs it created were smaller, or something. (Sorry, can't remember exactly.) Plus, novaPDF was cheaper, I think.
Anyways, what I think I discovered with Amyuni is that their OLE control isn't the sort that you can just create with ConnectToNewObject. Instead, you have to embed it in a window as a dropped-in control. So, I created an invisibile window at program startup, which contained the control, and used it from there. I'm attaching my code for that window. You can retrieve the OLE object from that window with the wf_get_printerobj() method, and then work with it as you do above.
You also need to destroy the window on program exit, I think.
Hello Dan,
Quite grateful, please can you send me the link to downloading the novaPDF you talked about and possible guide on how i can get it working for me.
Swansea, you do have to be willing to do a bit of the work yourself. All you have to do is Google "novaPDF" and it will come up. And their docs are pretty good.