mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 06:06:09 -06:00
[GH-ISSUE #506] Feature Request: Textboxes #392
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kruftindustries on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/506
Originally assigned to: @jmcnamara on GitHub.
Insert text boxes into worksheets with configurable size, position, and scaling options.
API Changes:
New struct in drawing.h:
typedef struct lxw_textbox_options {uint32_t width; /* Width in pixels (default 192) */uint32_t height; /* Height in pixels (default 120) */int32_t x_offset; /* X offset from cell in pixels */int32_t y_offset; /* Y offset from cell in pixels */double x_scale; /* X scale (default 1.0) */double y_scale; /* Y scale (default 1.0) */uint8_t object_position; /* Anchor position */const char *description; /* Alt text description */} lxw_textbox_options;New functions:
lxw_error worksheet_insert_textbox(lxw_worksheet *worksheet,lxw_row_t row, lxw_col_t col,const char *text);lxw_error worksheet_insert_textbox_opt(lxw_worksheet *worksheet,lxw_row_t row, lxw_col_t col,const char *text,lxw_textbox_options *options);Code Example:
#include "xlsxwriter.h"int main() {lxw_workbook *workbook = workbook_new("textbox.xlsx");lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);/* Simple textbox */worksheet_insert_textbox(worksheet, 1, 1, "Hello World!");/* Textbox with custom size */lxw_textbox_options options = {.width = 300,.height = 150,.x_offset = 10,.y_offset = 10};worksheet_insert_textbox_opt(worksheet, 8, 1, "Custom textbox", &options);return workbook_close(workbook);}@jmcnamara commented on GitHub (Jan 12, 2026):
This is a somewhat useful feature. I would probably make this a medium term priority.