There is no way with plain magento to prepare a download response by clicking the print invoice button.
You could overwrite the controller action in a custom module like this:
require Mage::getModuleDir('controllers','Mage_Sales') . DS . 'OrderController.php';
class Namespace_Module_Sales_OrderController extends Mage_Sales_OrderController{
/**
* Print Order Action
*/
public function printAction()
{
if (!$this->_loadValidOrder()) {
return;
}
/**
* your custom code for download pdf here
*/
}
}
and in config.xml you need to populate the controller for mage sales:
[...]
</global>
<frontend>
<routers>
<sales>
<args>
<modules>
<namespace_module before="Mage_Sales">Namespace_Module_Sales</namespace_module>
</modules>
</args>
</sales>
</routers>
</frontend>
[...]