@Override public int getPreferredContentsHeight( ParagraphRenderStyle defaultStyle, int yStart, ContainerRenderSpace containerRenderSpace, int sideIndents) { FallbackParagraphRenderStyle fallbackStyle = new FallbackParagraphRenderStyle(paragraphRenderStyle, defaultStyle); int containerWidth = containerRenderSpace.getContainerWidth(); int topIndent = fallbackStyle.getParagraphMarginTop().getValue(containerWidth) + fallbackStyle.getParagraphPaddingTop().getValue(containerWidth); int paragraphIndents = topIndent + fallbackStyle.getParagraphPaddingBottom().getValue(containerWidth) + fallbackStyle.getParagraphMarginBottom().getValue(containerWidth); return paragraphIndents + DocumentRenderer.getParagraphsPreferredHeight( fallbackStyle, paragraphs, containerRenderSpace, yStart + topIndent); }