public void ensureHasPage(CssContext c, Box box) { getLastPage(c, box); }
private void exportPageBoxText(RenderingContext c, Writer writer) throws IOException { c.getPage().exportTrailingText(c, writer); if (c.getPage() != c.getRootLayer().getLastPage()) { List pages = c.getRootLayer().getPages(); do { PageBox next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); next.exportLeadingText(c, writer); next.exportTrailingText(c, writer); } while (c.getPage() != c.getRootLayer().getLastPage()); } }
private void exportPageBoxText(RenderingContext c, Writer writer) throws IOException { c.getPage().exportTrailingText(c, writer); if (c.getPage() != c.getRootLayer().getLastPage()) { List pages = c.getRootLayer().getPages(); do { PageBox next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); next.exportLeadingText(c, writer); next.exportTrailingText(c, writer); } while (c.getPage() != c.getRootLayer().getLastPage()); } }
if (_layout_context.isPrint()) { rootLayer.trimEmptyPages(_layout_context, intrinsic_size.height); if (rootLayer.getLastPage() != null) { rootLayer.assignPagePaintingPositions(_layout_context, Layer.PAGED_MODE_SCREEN, PAGE_PAINTING_CLEARANCE); _drawnSize = new Point(rootLayer.getMaxPageWidth(_layout_context, PAGE_PAINTING_CLEARANCE), rootLayer.getLastPage().getPaintingBottom() + PAGE_PAINTING_CLEARANCE); } else {
private void paintPagedView(RenderingContext c, Layer root) { if (root.getLastPage() == null) { return; root.getLastPage().getPaintingBottom() + PAGE_PAINTING_CLEARANCE_HEIGHT)); revalidate();
private void paintPagedView(RenderingContext c, Layer root) { if (root.getLastPage() == null) { return; root.getLastPage().getPaintingBottom() + PAGE_PAINTING_CLEARANCE_HEIGHT)); revalidate();
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 BreakAtLineContext calcBreakAtLineContext(LayoutContext c) { if (! c.isPrint() || ! getStyle().isKeepWithInline()) { return null; } LineBox breakLine = findLastNthLineBox((int)getStyle().asFloat(CSSName.WIDOWS)); if (breakLine != null) { PageBox linePage = c.getRootLayer().getLastPage(c, breakLine); PageBox ourPage = c.getRootLayer().getLastPage(c, this); if (linePage != null && ourPage != null && linePage.getPageNo() + 1 == ourPage.getPageNo()) { BlockBox breakBox = (BlockBox)breakLine.getParent(); return new BreakAtLineContext(breakBox, breakBox.findOffset(breakLine)); } } return null; }
public BreakAtLineContext calcBreakAtLineContext(LayoutContext c) { if (! c.isPrint() || ! getStyle().isKeepWithInline()) { return null; } LineBox breakLine = findLastNthLineBox((int)getStyle().asFloat(CSSName.WIDOWS)); if (breakLine != null) { PageBox linePage = c.getRootLayer().getLastPage(c, breakLine); PageBox ourPage = c.getRootLayer().getLastPage(c, this); if (linePage != null && ourPage != null && linePage.getPageNo() + 1 == ourPage.getPageNo()) { BlockBox breakBox = (BlockBox)breakLine.getParent(); return new BreakAtLineContext(breakBox, breakBox.findOffset(breakLine)); } } return null; }
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); }
private void paintPagedView(RenderingContext c, Layer root) { if (root.getLastPage() == null) { return;
if (page.getTop() == getAbsY()) { pageBreakCount--; if (pendingPageName && page == c.getRootLayer().getLastPage()) { c.getRootLayer().removeLastPage(); c.setPageName(c.getPendingPageName()); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c);
if (page.getTop() == getAbsY()) { pageBreakCount--; if (pendingPageName && page == c.getRootLayer().getLastPage()) { c.getRootLayer().removeLastPage(); c.setPageName(c.getPendingPageName()); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c); if (page == c.getRootLayer().getLastPage()) { c.getRootLayer().addPage(c);
private PagePosition calcPDFPagePosition(CssContext c, String id, Box box) { PageBox page = _root.getLayer().getLastPage(c, box); if (page == null) { return null; } float x = box.getAbsX() + page.getMarginBorderPadding(c, CalculatedStyle.LEFT); float y = (page.getBottom() - (box.getAbsY() + box.getHeight())) + page.getMarginBorderPadding(c, CalculatedStyle.BOTTOM); x /= _dotsPerPoint; y /= _dotsPerPoint; PagePosition result = new PagePosition(); result.setId(id); result.setPageNo(page.getPageNo()); result.setX(x); result.setY(y); result.setWidth(box.getEffectiveWidth() / _dotsPerPoint); result.setHeight(box.getHeight() / _dotsPerPoint); return result; } }
private PagePosition calcPDFPagePosition(CssContext c, String id, Box box) { PageBox page = _root.getLayer().getLastPage(c, box); if (page == null) { return null; } float x = box.getAbsX() + page.getMarginBorderPadding(c, CalculatedStyle.LEFT); float y = (page.getBottom() - (box.getAbsY() + box.getHeight())) + page.getMarginBorderPadding(c, CalculatedStyle.BOTTOM); x /= _dotsPerPoint; y /= _dotsPerPoint; PagePosition result = new PagePosition(); result.setId(id); result.setPageNo(page.getPageNo()); result.setX(x); result.setY(y); result.setWidth(box.getEffectiveWidth() / _dotsPerPoint); result.setHeight(box.getHeight() / _dotsPerPoint); return result; } }
private PagePosition calcPDFPagePosition(CssContext c, String id, Box box) { PageBox page = _root.getLayer().getLastPage(c, box); if (page == null) { return null; } float x = box.getAbsX() + page.getMarginBorderPadding(c, CalculatedStyle.LEFT); float y = (page.getBottom() - (box.getAbsY() + box.getHeight())) + page.getMarginBorderPadding(c, CalculatedStyle.BOTTOM); x /= _dotsPerPoint; y /= _dotsPerPoint; PagePosition result = new PagePosition(); result.setId(id); result.setPageNo(page.getPageNo()); result.setX(x); result.setY(y); result.setWidth(box.getEffectiveWidth() / _dotsPerPoint); result.setHeight(box.getHeight() / _dotsPerPoint); return result; } }
private PagePosition calcPDFPagePosition(CssContext c, String id, Box box) { PageBox page = _root.getLayer().getLastPage(c, box); if (page == null) { return null; } float x = box.getAbsX() + page.getMarginBorderPadding(c, CalculatedStyle.LEFT); float y = (page.getBottom() - (box.getAbsY() + box.getHeight())) + page.getMarginBorderPadding(c, CalculatedStyle.BOTTOM); x /= _dotsPerPoint; y /= _dotsPerPoint; PagePosition result = new PagePosition(); result.setId(id); result.setPageNo(page.getPageNo()); result.setX(x); result.setY(y); result.setWidth(box.getEffectiveWidth() / _dotsPerPoint); result.setHeight(box.getHeight() / _dotsPerPoint); return result; } }
private PagePosition calcPDFPagePosition(CssContext c, String id, Box box) { PageBox page = _root.getLayer().getLastPage(c, box); if (page == null) { return null; } float x = box.getAbsX() + page.getMarginBorderPadding(c, CalculatedStyle.LEFT); float y = (page.getBottom() - (box.getAbsY() + box.getHeight())) + page.getMarginBorderPadding(c, CalculatedStyle.BOTTOM); x /= _dotsPerPoint; y /= _dotsPerPoint; PagePosition result = new PagePosition(); result.setId(id); result.setPageNo(page.getPageNo()); result.setX(x); result.setY(y); result.setWidth(box.getEffectiveWidth() / _dotsPerPoint); result.setHeight(box.getHeight() / _dotsPerPoint); return result; } }