private Rectangle getCurrentPageEffectiveArea(PageSize pageSize) { float leftMargin = (float) getPropertyAsFloat(Property.MARGIN_LEFT); float bottomMargin = (float) getPropertyAsFloat(Property.MARGIN_BOTTOM); float topMargin = (float) getPropertyAsFloat(Property.MARGIN_TOP); float rightMargin = (float) getPropertyAsFloat(Property.MARGIN_RIGHT); return new Rectangle(pageSize.getLeft() + leftMargin, pageSize.getBottom() + bottomMargin, pageSize.getWidth() - leftMargin - rightMargin, pageSize.getHeight() - bottomMargin - topMargin); }
private Rectangle getCurrentPageEffectiveArea(PageSize pageSize) { float leftMargin = (float) getPropertyAsFloat(Property.MARGIN_LEFT); float bottomMargin = (float) getPropertyAsFloat(Property.MARGIN_BOTTOM); float topMargin = (float) getPropertyAsFloat(Property.MARGIN_TOP); float rightMargin = (float) getPropertyAsFloat(Property.MARGIN_RIGHT); return new Rectangle(pageSize.getLeft() + leftMargin, pageSize.getBottom() + bottomMargin, pageSize.getWidth() - leftMargin - rightMargin, pageSize.getHeight() - bottomMargin - topMargin); }
/** * Returns the area that will actually be used to write on the page, given * the current margins. Does not have any side effects on the document. * * @param pageSize the size of the page to * @return a {@link Rectangle} with the required dimensions and origin point */ public Rectangle getPageEffectiveArea(PageSize pageSize) { float x = pageSize.getLeft() + getLeftMargin(); float y = pageSize.getBottom() + getBottomMargin(); float width = pageSize.getWidth() - getLeftMargin() - getRightMargin(); float height = pageSize.getHeight() - getBottomMargin() - getTopMargin(); return new Rectangle(x, y, width, height); }
/** * Returns the area that will actually be used to write on the page, given * the current margins. Does not have any side effects on the document. * * @param pageSize the size of the page to * @return a {@link Rectangle} with the required dimensions and origin point */ public Rectangle getPageEffectiveArea(PageSize pageSize) { float x = pageSize.getLeft() + getLeftMargin(); float y = pageSize.getBottom() + getBottomMargin(); float width = pageSize.getWidth() - getLeftMargin() - getRightMargin(); float height = pageSize.getHeight() - getBottomMargin() - getTopMargin(); return new Rectangle(x, y, width, height); }