Adding EmailPDF to contacts detail view

I can;t see this being as straight forward as the tutorial of adding Generate PDF to a custom module,

So I am wandering if someone is able to point me in the right direction, the Email PDF button in Invoices and Quotes, I would like to have this option in the contacts page, can anyone guide me.

I am trying to do the same thing in a custom module, I have added a generate PDF button in several modules already now i would like to be email to email said PDF without reuploading it into the email client.
I had a look in the Quotes, Invoices and Contracts module, got a second button working by adding the following to detailviewdefs.php

        'buttons' =>
        array (
          0 => 'EDIT',
          1 => 'DUPLICATE',
          2 => 'DELETE',
          3 =>
           array ('customCode' => '<input type="button" id="generatePdf" name="generatePdf" class="button" value="Generate PDF"

onclick=“showPopup(‘pdf’);”>’),
4 =>
array (
‘customCode’ => ‘’,
),

Now both buttons are generating a PDF !

I am pretty sure something else has to be done, possibly into custom/custom_module/views/view.detail.php but what ?

Hope you have made some progress with this.