Button click to generate a pdf

Hi All

Im able to generate a pdf in the detailview of a record. Now I want to generate a pdf but on button click while creating an account. For example, I have added a button in the editviewdefs of my module using the following line:

‘customCode’ => ‘’,

Right now this just gives me the heading in popup-i used it to check button click functionality. I know I need to add some function in the onclick field. I have also copied the view.edit file in my modules view folder. I am just stuck in a little hint about how to call a function that would generate the pdf on the button click.

Thanks a lot in advance.