PageBox result = new PageBox(); String pageName = null; // HACK We only create pages during layout, but the OutputDevice // queries page positions and since pages are created lazily, changing // this method to use LayoutContext is tricky if (c instanceof LayoutContext) { pageName = ((LayoutContext)c).getPageName(); } PageInfo pageInfo = c.getCss().getPageStyle(pageName, pseudoPage); result.setPageInfo(pageInfo); CalculatedStyle cs = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); result.setStyle(cs); result.setOuterPageWidth(result.getWidth(c)); return result; } public PageBox getFirstPage(CssContext c, Box box) {
public static PageBox createPageBox(CssContext c, String pseudoPage) { PageBox result = new PageBox(); String pageName = null; // HACK We only create pages during layout, but the OutputDevice // queries page positions and since pages are created lazily, changing // this method to use LayoutContext is tricky if (c instanceof LayoutContext) { pageName = ((LayoutContext)c).getPageName(); } PageInfo pageInfo = c.getCss().getPageStyle(pageName, pseudoPage); result.setPageInfo(pageInfo); CalculatedStyle cs = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); result.setStyle(cs); result.setOuterPageWidth(result.getWidth(c)); return result; }