/** * Gets the copy of this rectangle. * * @return the copied rectangle. */ public Rectangle clone() { return new Rectangle(x, y, width, height); }
/** * Gets the barcode size * @param moduleHeight The height of the module * @param moduleWidth The width of the module * @return The size of the barcode */ public Rectangle getBarcodeSize(float moduleHeight, float moduleWidth) { return new Rectangle(0, 0, (width + 2 * ws) * moduleHeight, (height + 2 * ws) * moduleWidth); }
@Override public Rectangle getBarcodeSize() { float width = ((code.length() + 1) * 5 + 1) * n + x; return new Rectangle(width, barHeight); }
/** * Sets the rectangle that represent the position and dimension of * the signature field in the page. * * @param pageRect The rectangle that represents the position and * dimension of the signature field in the page. */ public PdfSignatureAppearance setPageRect(Rectangle pageRect) { this.pageRect = new Rectangle(pageRect); this.rect = new Rectangle(pageRect.getWidth(), pageRect.getHeight()); return this; }
/** * Creates a Link which can execute an action. * * @param text the textual contents of the link * @param action a {@link PdfAction} */ public Link(String text, PdfAction action) { this(text, (PdfLinkAnnotation) new PdfLinkAnnotation(new Rectangle(0, 0, 0, 0)).setAction(action).setFlags(PdfAnnotation.PRINT)); }
/** * Creates a Link which can execute an action. * * @param text the textual contents of the link * @param action a {@link PdfAction} */ public Link(String text, PdfAction action) { this(text, (PdfLinkAnnotation) new PdfLinkAnnotation(new Rectangle(0, 0, 0, 0)).setAction(action).setFlags(PdfAnnotation.PRINT)); }
/** * Creates a Link to another location in the document. * * @param text the textual contents of the link * @param destination a {@link PdfDestination} */ public Link(String text, PdfDestination destination) { this(text, (PdfLinkAnnotation) new PdfLinkAnnotation(new Rectangle(0, 0, 0, 0)).setDestination(destination).setFlags(PdfAnnotation.PRINT)); }
/** * Gets the barcode size * @param moduleSize The module size * @return The size of the barcode */ public Rectangle getBarcodeSize(float moduleSize) { return new Rectangle(0, 0, bm.getWidth() * moduleSize, bm.getHeight() * moduleSize); }
@Override public MinMaxWidth getMinMaxWidth() { TextLayoutResult result = (TextLayoutResult) layout(new LayoutContext(new LayoutArea(1, new Rectangle(MinMaxWidthUtils.getInfWidth(), AbstractRenderer.INF)))); return result.getMinMaxWidth(); }
@Override public MinMaxWidth getMinMaxWidth() { LineLayoutResult result = (LineLayoutResult) layout(new LayoutContext(new LayoutArea(1, new Rectangle(MinMaxWidthUtils.getInfWidth(), AbstractRenderer.INF)))); return result.getMinMaxWidth(); }
@Override public MinMaxWidth getMinMaxWidth() { TextLayoutResult result = (TextLayoutResult) layout(new LayoutContext(new LayoutArea(1, new Rectangle(MinMaxWidthUtils.getInfWidth(), AbstractRenderer.INF)))); return result.getMinMaxWidth(); }
/** * Gets the size of the barcode grid */ @Override public Rectangle getBarcodeSize() { return new Rectangle(0, 0, bm.getWidth(), bm.getHeight()); }
private static float calculatePaddingBorderHeight(AbstractRenderer renderer) { Rectangle dummy = new Rectangle(0, 0); renderer.applyBorderBox(dummy, true); renderer.applyPaddings(dummy, true); return dummy.getHeight(); }
private static float calculatePaddingBorderWidth(AbstractRenderer renderer) { Rectangle dummy = new Rectangle(0, 0); renderer.applyBorderBox(dummy, true); renderer.applyPaddings(dummy, true); return dummy.getWidth(); }
private static float calculatePaddingBorderHeight(AbstractRenderer renderer) { Rectangle dummy = new Rectangle(0, 0); renderer.applyBorderBox(dummy, true); renderer.applyPaddings(dummy, true); return dummy.getHeight(); }
private static float calculatePaddingBorderWidth(AbstractRenderer renderer) { Rectangle dummy = new Rectangle(0, 0); renderer.applyBorderBox(dummy, true); renderer.applyPaddings(dummy, true); return dummy.getWidth(); }
public static MinMaxWidth countDefaultMinMaxWidth(IRenderer renderer) { LayoutResult result = renderer.layout(new LayoutContext(new LayoutArea(1, new Rectangle(getInfWidth(), getInfHeight())))); return result.getStatus() == LayoutResult.NOTHING ? new MinMaxWidth() : new MinMaxWidth(0, result.getOccupiedArea().getBBox().getWidth(), 0); }
@Override public LayoutResult layout(LayoutContext layoutContext) { LayoutArea area = layoutContext.getArea(); Float width = retrieveWidth(area.getBBox().getWidth()); UnitValue height = this.<UnitValue>getProperty(Property.MIN_HEIGHT); occupiedArea = new LayoutArea(area.getPageNumber(), new Rectangle(area.getBBox().getX(), area.getBBox().getY() + area.getBBox().getHeight(),(float) width, (float) height.getValue())); return new LayoutResult(LayoutResult.FULL, occupiedArea, null, null); }
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); }