private void addPagesUntilPosition(CssContext c, int position) { List pages = getPages(); PageBox last = (PageBox)pages.get(pages.size()-1); while (position >= last.getBottom()) { addPage(c); last = (PageBox)pages.get(pages.size()-1); } }
List pages = getPages(); PageBox last = (PageBox)pages.get(pages.size()-1); while (position >= last.getBottom()) { addPage(c); last = (PageBox)pages.get(pages.size()-1); } } public void trimEmptyPages(CssContext c, int maxYHeight) {
c.getRootLayer().addPage(c);
c.getRootLayer().addPage(c);
public void forcePageBreakAfter(LayoutContext c, IdentValue pageBreakValue) { boolean needSecondPageBreak = false; PageBox page = c.getRootLayer().getLastPage(c, this); if ((page.isLeftPage() && pageBreakValue == IdentValue.LEFT) || (page.isRightPage() && pageBreakValue == IdentValue.RIGHT)) { needSecondPageBreak = true; } int delta = page.getBottom() + c.getExtraSpaceTop() - (getAbsY() + getMarginBorderPadding(c, CalculatedStyle.TOP) + getHeight()); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); } if (needSecondPageBreak) { page = (PageBox)c.getRootLayer().getPages().get(page.getPageNo()+1); delta += page.getContentHeight(c); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); } } setHeight(getHeight() + delta); }
public void forcePageBreakAfter(LayoutContext c, IdentValue pageBreakValue) { boolean needSecondPageBreak = false; PageBox page = c.getRootLayer().getLastPage(c, this); if ((page.isLeftPage() && pageBreakValue == IdentValue.LEFT) || (page.isRightPage() && pageBreakValue == IdentValue.RIGHT)) { needSecondPageBreak = true; } int delta = page.getBottom() + c.getExtraSpaceTop() - (getAbsY() + getMarginBorderPadding(c, CalculatedStyle.TOP) + getHeight()); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); } if (needSecondPageBreak) { page = (PageBox)c.getRootLayer().getPages().get(page.getPageNo()+1); delta += page.getContentHeight(c); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); } } setHeight(getHeight() + delta); }
public static BlockBox createRootBox(LayoutContext c, Document document) { Element root = document.getDocumentElement(); CalculatedStyle style = c.getSharedContext().getStyle(root); BlockBox result; if (style.isTable() || style.isInlineTable()) { result = new TableBox(); } else { result = new BlockBox(); } result.setStyle(style); result.setElement(root); c.resolveCounters(style); c.pushLayer(result); if (c.isPrint()) { if (! style.isIdent(CSSName.PAGE, IdentValue.AUTO)) { c.setPageName(style.getStringProperty(CSSName.PAGE)); } c.getRootLayer().addPage(c); } return result; }
public static BlockBox createRootBox(LayoutContext c, Document document) { Element root = document.getDocumentElement(); CalculatedStyle style = c.getSharedContext().getStyle(root); BlockBox result; if (style.isTable() || style.isInlineTable()) { result = new TableBox(); } else { result = new BlockBox(); } result.setStyle(style); result.setElement(root); c.resolveCounters(style); c.pushLayer(result); if (c.isPrint()) { if (! style.isIdent(CSSName.PAGE, IdentValue.AUTO)) { c.setPageName(style.getStringProperty(CSSName.PAGE)); } c.getRootLayer().addPage(c); } return result; }