list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");

list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
