Commit 02c31b8
Add text truncation for multi-column header text in PDF export
Implemented text truncation with ellipsis for column headers when text is wider
than the available header space. This applies to both:
1. Multi-level column headers (column groups) in drawMultiLevelHeaders
2. Simple column headers in drawTableHeaders
The truncation logic:
- Calculates max text width as column width minus 10px padding (5px each side)
- If header text exceeds available space, truncates character by character
- Adds ellipsis (...) to indicate truncation
- Similar to existing cell value truncation logic
Also added test case to verify truncation works with nested column groups on
smaller page size (a5) where truncation is more likely to occur.
This prevents header text from overflowing cell boundaries and overlapping with
adjacent headers, maintaining proper PDF layout.
Co-authored-by: kdinev <[email protected]>1 parent 1381a69 commit 02c31b8
File tree
2 files changed
+47
-3
lines changed- projects/igniteui-angular/src/lib/services/pdf
2 files changed
+47
-3
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
366 | 391 | | |
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
284 | 294 | | |
285 | 295 | | |
286 | 296 | | |
| |||
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
317 | | - | |
| 327 | + | |
318 | 328 | | |
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
322 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
323 | 342 | | |
324 | 343 | | |
325 | 344 | | |
| |||
0 commit comments