window.print() automatically.
Print flow for windows
Click IMPRIMIR
In the Sistema Nova interface, click the IMPRIMIR button. This fires the Livewire
imprimirTodo() action, which calculates the full fabrication data for every open window tab and writes the result to the PHP session under the key datos_lote.Session data saved
session()->save() is called explicitly to flush the session to storage before the iframe navigation begins. This guarantees the data is available when the print route reads it.Iframe loads the print view
The
disparar-impresion-total browser event sets the src of a hidden <iframe id="iframeLote"> to the plano.imprimir route (/plano-imprimir). The route reads datos_lote from the session and renders the planos2d Blade view.Print flow for doors
The door print flow follows the same pattern but uses a different route and view:| Windows | Doors | |
|---|---|---|
| Route name | plano.imprimir | puertas.imprimir |
| URL | /plano-imprimir | /puertas-imprimir |
| Session key | datos_lote | puertas |
| Blade view | planos2d | planos2dPuerta |
What the printed output includes
Each window or door in the batch produces one print block containing:- A header with the window/door name, total dimensions, and adjusted width.
- The 2D technical plan with all dimension arrows and proportionally scaled panel layout.
- A fabrication materials table listing every profile and accessory with catalog code, cut length in cm, and quantity.
datos.xlsx.
When printing more than three windows, the planos2d view switches to a two-column grid layout to fit more plans per A4 page.
CSS print configuration
Both print views use@media print rules to ensure correct output:
-webkit-print-color-adjust: exact declaration is critical — without it, most browsers suppress background colors and the panel color coding (blue for sliding, light blue for fixed) would not appear in the printed output.
Session cleanup after printing
The Vaciar button (and the
confirmarImpresion() method it calls) clears both the datos_lote and ventanas session keys and resets the component to a single default window. Call this after printing is complete to start a fresh configuration.