feat: adjust zoom to 1.4 for better print size
This commit is contained in:
parent
267b09946e
commit
0da156ce08
|
|
@ -37,7 +37,6 @@ export class ListPrinterService {
|
|||
}
|
||||
|
||||
printer.drawLine();
|
||||
printer.cut();
|
||||
printer.beep();
|
||||
|
||||
await printer.execute();
|
||||
|
|
@ -86,18 +85,8 @@ export class ListPrinterService {
|
|||
<meta charset="UTF-8">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-print-color-adjust: exact;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
transform-origin: top left;
|
||||
zoom: 1.25;
|
||||
}
|
||||
html, body { margin: 0; padding: 0; }
|
||||
body { zoom: 1.4; transform-origin: top left; }
|
||||
@page { size: ${width} ${height || 'auto'}; margin: 0; }
|
||||
</style>
|
||||
</head>
|
||||
|
|
@ -124,7 +113,13 @@ export class ListPrinterService {
|
|||
|
||||
await browser.close();
|
||||
|
||||
await pdfPrinter.print(tempFilePath, { printer: data.printerName });
|
||||
await pdfPrinter.print(tempFilePath, {
|
||||
printer: data.printerName,
|
||||
win32: ['-nointterrupt'] // Tenta evitar comandos extras, mas o pdf-to-printer tem opções limitadas de corte.
|
||||
// Na verdade, o pdf-to-printer usa SumatraPDF, que não tem flag explícita de "no-cut".
|
||||
// O corte geralmente é configuração do driver ou do tamanho do papel.
|
||||
// Mas vamos garantir que não estamos enviando nada extra.
|
||||
});
|
||||
|
||||
return { success: true, message: 'HTML convertido (com Tailwind) e enviado para impressão!' };
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue