ESC/P 2: Exact paper sizes, 1/36" margins

This commit is contained in:
Lili1228
2026-02-06 22:32:46 +01:00
parent 50b961e0b6
commit c3094d022d
2 changed files with 14 additions and 14 deletions

View File

@@ -542,7 +542,7 @@ init_codepage(escp_t *dev, uint16_t num)
static void
reset_printer(escp_t *dev)
{
dev->top_margin = dev->left_margin = 0.0;
dev->top_margin = dev->left_margin = 1.0 / 36.0;
dev->right_margin = dev->page_width;
switch (dev->paper_size) {
case PAPER_A4:
@@ -558,7 +558,7 @@ reset_printer(escp_t *dev)
default:
dev->page_height = LETTER_PAGE_HEIGHT;
}
dev->bottom_margin = dev->page_height;
dev->bottom_margin = dev->page_height - 1.0 / 36.0;
/* TODO: these should be configurable. */
dev->color = COLOR_BLACK;
dev->curr_x = dev->curr_y = 0.0;