diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/HtmlToWorldBuilder.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/HtmlToWorldBuilder.java index 5badc0f67..ca83f8933 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/HtmlToWorldBuilder.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/HtmlToWorldBuilder.java @@ -75,6 +75,7 @@ public class HtmlToWorldBuilder implements NodeVisitor { private void parseProperties(Node node) { properties.entrySet().forEach(stringBooleanEntry -> { + this.run.setFontSize(11); switch (stringBooleanEntry.getKey()) { case "i" : case "em": @@ -121,6 +122,9 @@ public class HtmlToWorldBuilder implements NodeVisitor { if (stringBooleanEntry.getValue()) { if (node.hasAttr("align")) { String alignment = node.attr("align"); + if(alignment.toUpperCase(Locale.ROOT).equals("JUSTIFY")) { + alignment = "both"; + } this.paragraph.setAlignment(ParagraphAlignment.valueOf(alignment.toUpperCase(Locale.ROOT))); } } @@ -213,6 +217,28 @@ public class HtmlToWorldBuilder implements NodeVisitor { this.run.addBreak(); } break; + case "h1": + System.out.println(this.run.getFontSize()); + this.run.setFontSize(24); + break; + case "h2": + this.run.setFontSize(20); + break; + case "h3": + this.run.setFontSize(16); + break; + case "h4": + this.run.setFontSize(14); + this.run.setBold(stringBooleanEntry.getValue()); + break; + case "h5": + this.run.setFontSize(14); + break; + case "h6": + this.run.setFontSize(11); + this.run.setBold(stringBooleanEntry.getValue()); + this.run.setCapitalized(stringBooleanEntry.getValue()); + break; } }); }