Step 1: Customize the invoice as needed on Frontend download page (In this example we only insert the Invoice download button, but you could insert the Refund download button as well), then hit Copy to copy the code:

Step 2: On Shopify admin page, click on Online Store -> Themes, then Actions -> Edit code:

Step 3: Look for customer/order.liquid, then paste the code at the bottom, adn hit Save:

Customers can now see that button(s) when they view orders from their Account page.