diff --git a/openpdf/src/main/java/com/lowagie/text/html/HtmlWriter.java b/openpdf/src/main/java/com/lowagie/text/html/HtmlWriter.java index 24fc18e54..058328db4 100644 --- a/openpdf/src/main/java/com/lowagie/text/html/HtmlWriter.java +++ b/openpdf/src/main/java/com/lowagie/text/html/HtmlWriter.java @@ -667,6 +667,7 @@ protected void write(Element element, int indent) throws IOException { case Element.PHRASE: { Phrase phrase = (Phrase) element; styleAttributes = new Properties(); + styleAttributes.setProperty(Markup.CSS_KEY_DISPLAY, Markup.CSS_VALUE_GRID); if (phrase.hasLeading()) { styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, phrase.getLeading() + "pt"); } @@ -691,6 +692,7 @@ protected void write(Element element, int indent) throws IOException { case Element.ANCHOR: { Anchor anchor = (Anchor) element; styleAttributes = new Properties(); + styleAttributes.setProperty(Markup.CSS_KEY_DISPLAY, Markup.CSS_VALUE_GRID); if (anchor.hasLeading()) { styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, anchor.getLeading() + "pt"); } @@ -721,9 +723,11 @@ protected void write(Element element, int indent) throws IOException { case Element.PARAGRAPH: { Paragraph paragraph = (Paragraph) element; styleAttributes = new Properties(); + styleAttributes.setProperty(Markup.CSS_KEY_DISPLAY, Markup.CSS_VALUE_GRID); if (paragraph.hasLeading()) { styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, paragraph.getTotalLeading() + "pt"); } + // start tag addTabs(indent); writeStart(HtmlTags.DIV); @@ -990,6 +994,7 @@ protected void writeSection(Section section, int indent) throws IOException { depth = 5; } Properties styleAttributes = new Properties(); + styleAttributes.setProperty(Markup.CSS_KEY_DISPLAY, Markup.CSS_VALUE_GRID); if (section.getTitle().hasLeading()) { styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, section.getTitle().getTotalLeading() + "pt"); } diff --git a/openpdf/src/main/java/com/lowagie/text/html/Markup.java b/openpdf/src/main/java/com/lowagie/text/html/Markup.java index a101fd332..b55172529 100644 --- a/openpdf/src/main/java/com/lowagie/text/html/Markup.java +++ b/openpdf/src/main/java/com/lowagie/text/html/Markup.java @@ -320,6 +320,11 @@ public class Markup { */ public static final String CSS_VALUE_BLOCK = "block"; + /** + * A possible value for the DISPLAY key + */ + public static final String CSS_VALUE_GRID = "grid"; + /** * a CSS value for text font weight */