# easy-invoice/2.4.2/templates/invoice-view.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.4.2. 34 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.2/code/templates/invoice-view.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.2/raw/templates/invoice-view.php
- Modified: 2026-09-15T12:31:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.4.2/code/templates/invoice-view.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
// Enqueue PDF scripts
EasyInvoice\Includes\Helpers\PdfHelper::enqueuePdfScripts();
?>

<div class="wrap">
    <h1>Invoice #<?php echo esc_html($invoice->getNumber()); ?></h1>
    
    <div class="invoice-actions">
        <button type="button" class="button button-primary" id="generate-pdf">
            Download PDF
        </button>
    </div>

</div>

<script>
document.addEventListener('DOMContentLoaded', function() {
    const generatePdfButton = document.getElementById('generate-pdf');

    generatePdfButton.addEventListener('click', function() {
        // Use the new PDF generator that captures HTML directly
        if (typeof InvoicePdfGenerator !== 'undefined') {
            const pdfGenerator = new InvoicePdfGenerator();
            pdfGenerator.generatePDF();
        } else {
            alert('PDF generator not available');
        }
    });
});
</script> 
```
