public ContentLimitContainer(LayoutContext c, int startAbsY) { _initialPageNo = getPage(c, startAbsY).getPageNo(); }
public ContentLimitContainer(LayoutContext c, int startAbsY) { _initialPageNo = getPage(c, startAbsY).getPageNo(); }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
public boolean isNeedsKeepWithInline(LayoutContext c) { if (c.isPrint() && getStyle().isKeepWithInline()) { LineBox line = findFirstLineBox(); if (line != null) { PageBox linePage = c.getRootLayer().getFirstPage(c, line); PageBox ourPage = c.getRootLayer().getFirstPage(c, this); return linePage != null && ourPage != null && linePage.getPageNo() == ourPage.getPageNo()+1; } } return false; }
public boolean isNeedsKeepWithInline(LayoutContext c) { if (c.isPrint() && getStyle().isKeepWithInline()) { LineBox line = findFirstLineBox(); if (line != null) { PageBox linePage = c.getRootLayer().getFirstPage(c, line); PageBox ourPage = c.getRootLayer().getFirstPage(c, this); return linePage != null && ourPage != null && linePage.getPageNo() == ourPage.getPageNo()+1; } } return false; }
public void updateTop(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateTop(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateTop(c, absY); } }
protected void exportPageBoxText(RenderingContext c, Writer writer, int yPos) throws IOException { c.getPage().exportTrailingText(c, writer); List pages = c.getRootLayer().getPages(); PageBox next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); while (next.getBottom() < yPos) { next.exportLeadingText(c, writer); next.exportTrailingText(c, writer); next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); } next.exportLeadingText(c, writer); }
public void updateTop(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateTop(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateTop(c, absY); } }
protected void exportPageBoxText(RenderingContext c, Writer writer, int yPos) throws IOException { c.getPage().exportTrailingText(c, writer); List pages = c.getRootLayer().getPages(); PageBox next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); while (next.getBottom() < yPos) { next.exportLeadingText(c, writer); next.exportTrailingText(c, writer); next = (PageBox)pages.get(c.getPageNo()+1); c.setPage(next.getPageNo(), next); } next.exportLeadingText(c, writer); }
public void updateBottom(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateBottom(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateBottom(c, absY); } }
public void updateBottom(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateBottom(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateBottom(c, absY); } }
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; }
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()); } }
private PdfDestination createDestination(RenderingContext c, Box box) { PdfDestination result = null; PageBox page = _root.getLayer().getPage(c, getPageRefY(box)); if (page != null) { int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() + box.getMargin(c).top() - page.getTop(); result = new PdfDestination(PdfDestination.XYZ, 0, page.getHeight(c) / _dotsPerPoint - distanceFromTop / _dotsPerPoint, 0); result.addPage(_writer.getPageReference(_startPageNo + page.getPageNo() + 1)); } return result; }
private PdfDestination createDestination(RenderingContext c, Box box) { PdfDestination result = null; PageBox page = _root.getLayer().getPage(c, getPageRefY(box)); if (page != null) { int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() + box.getMargin(c).top() - page.getTop(); result = new PdfDestination(PdfDestination.XYZ, 0, page.getHeight(c) / _dotsPerPoint - distanceFromTop / _dotsPerPoint, 0); result.addPage(_writer.getPageReference(_startPageNo + page.getPageNo() + 1)); } return result; }
private PdfDestination createDestination(RenderingContext c, Box box) { PdfDestination result; PageBox page = _root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() + box.getMargin(c).top() - page.getTop(); result = new PdfDestination(PdfDestination.XYZ, 0, page.getHeight(c) / _dotsPerPoint - distanceFromTop / _dotsPerPoint, 0); result.addPage(_writer.getPageReference(_startPageNo + page.getPageNo() + 1)); return result; }
private PdfDestination createDestination(RenderingContext c, Box box) { PdfDestination result; PageBox page = _root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() + box.getMargin(c).top() - page.getTop(); result = new PdfDestination( PdfDestination.XYZ, 0, page.getHeight(c) / _dotsPerPoint - distanceFromTop / _dotsPerPoint, 0); result.addPage(_writer.getPageReference(_startPageNo + page.getPageNo()+1)); return result; }
private PdfDestination createDestination(RenderingContext c, Box box) { PdfDestination result; PageBox page = _root.getLayer().getPage(c, getPageRefY(box)); int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP); distanceFromTop += box.getAbsY() + box.getMargin(c).top() - page.getTop(); result = new PdfDestination( PdfDestination.XYZ, 0, page.getHeight(c) / _dotsPerPoint - distanceFromTop / _dotsPerPoint, 0); result.addPage(_writer.getPageReference(_startPageNo + page.getPageNo()+1)); return result; }