diff options
-rw-r--r-- | pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java index 82d21b0f..234cf7a2 100644 --- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java +++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java @@ -386,7 +386,7 @@ public class PDFBoxTable { for (int i = 0; i < words.length; i++) { String word = words[i]; String[] lineBreaks = word.split("\n"); - if (lineBreaks.length > 1) { + if (lineBreaks.length > 1 || word.contains("\n")) { for (int j = 0; j < lineBreaks.length; j++) { String subword = lineBreaks[j]; // if (cLine + subword.length() > maxline) { @@ -407,6 +407,10 @@ public class PDFBoxTable { } cLineValue += subword + " "; } + if(lineBreaks.length == 1) { + lines.add(cLineValue.trim()); + cLineValue = ""; + } } else { String tmpLine = cLineValue + word; float size = font.getStringWidth(tmpLine) / 1000.0f * fontSize; |