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

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.1.10. 32 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.1.10/code/templates/invoice-view.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.1.10/raw/templates/invoice-view.php
- Modified: 2025-08-14T09:51:16+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.1.10/code/templates/invoice-view.php#L10-L20`.

```php
<?php
// 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>

    <!-- Rest of your invoice view template -->
</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> 
```
