[Question or Bug] Text without spaces overflows cell width
Space-less text overflows the width, like in this example:
If it was a bit longer it would actually break, but with this text "LONGUNSPLITTABLETEXTTHATHASNOSPACESATALL" it failed. It seems like the last letter can start printing or padding area.
Here's another example S letter overflowed to right padding area here also.

Style for those cells is pretty simple
const paramCell: CellDef = {
colSpan: 1,
content: '\nLONGUNSPLITTABLETEXTTHATHASNOSPACESATALL'
styles: { minCellWidth: this.minColumnWidth, cellPadding: this.cellPadding },
};
The bold label is printed manually and is only represnted by \n here
I think this is a bug in lib. Text should not overflow the padding area that much
Yes that looks like a bug! Can you post a complete example that reproduces the issue? I know that jspdf have some issues with calculating the width when using justified text for example.
I am using Angular 9 BTW
import * as jsPDF from 'jspdf';
import autoTable, { CellDef } from 'jspdf-autotable';
@Injectable({
providedIn: 'root'
})
export class PdfTableExportService {
public async generateTimeReport(){
const doc = new jsPDF();
const body: CellDef[][] = [];
const head: CellDef[][] = [];
body.push([{
colSpan: 1,
content: '\nLONGUNSPLITTABLETEXTTHATHASNOSPACESATALL',
styles: { cellWidth: 80, cellPadding: 1.5 },
}]);
doc.setFontStyle('normal');
autoTable(doc, {
rowPageBreak: 'avoid',
pageBreak: 'auto',
margin: 10,
head: head,
body: body,
theme: 'grid',
}
doc.save(`pdf.pdf`);
}
}
Result, it broke the line one character later than it should've

Turned out to be a jspdf bug, reported here : https://github.com/parallax/jsPDF/issues/3644