To get a file you need to force a browser to open some file. You should do this like print is made.
Add methods to create an url with parameter and handle request.
You should create link to open a page like this (where x is a real contact id):
href="modules/Yours/get_vcard.php?contact_id=x" target="_blank"
Then in your get_vcard.php file you should implement handler to load Epesi, read request variable, read record, check permission/is user logged in and finally return output if everything is ok.
For more info how we make this please review this new Printing handler introduced in the latest release. 😉
Regards,
Adam