/** * Gets the bounding width of this template. * * @return width the bounding width */ public float getWidth() { return bBox.getWidth(); }
/** * Gets the bounding width of this template. * * @return width the bounding width */ public float getWidth() { return bBox.getWidth(); }
/** * Gets the visibility status of the signature. * @return the visibility status of the signature */ public boolean isInvisible() { return rect == null || rect.getWidth() == 0 || rect.getHeight() == 0; }
/** * Gets the visibility status of the signature. * @return the visibility status of the signature */ public boolean isInvisible() { return rect == null || rect.getWidth() == 0 || rect.getHeight() == 0; }
/** Gets the maximum area that the barcode and the text, if * any, will occupy. The lower left corner is always (0, 0). * @return the size the barcode occupies. */ public Rectangle getBarcodeSize() { Rectangle rect = ean.getBarcodeSize(); rect.setRight(rect.getWidth() + supp.getBarcodeSize().getWidth() + n); return rect; }
/** Gets the maximum area that the barcode and the text, if * any, will occupy. The lower left corner is always (0, 0). * @return the size the barcode occupies. */ public Rectangle getBarcodeSize() { Rectangle rect = ean.getBarcodeSize(); rect.setRight(rect.getWidth() + supp.getBarcodeSize().getWidth() + n); return rect; }
/** * Scale the image to the dimensions of the rectangle * * @param rectangle dimensions to scale the Image */ public void scaleAbsolute(final Rectangle rectangle) { scaleAbsolute(rectangle.getWidth(), rectangle.getHeight()); }
/** * Scales the images to the dimensions of the rectangle. * * @param rectangle the dimensions to fit */ public void scaleToFit(final Rectangle rectangle) { scaleToFit(rectangle.getWidth(), rectangle.getHeight()); }
public Rectangle getDocumentArtBox() { return new Rectangle( documentMargin.marginLeft, documentMargin.marginBottom, pageSize.getWidth() - documentMargin.marginRight, pageSize.getHeight() - documentMargin.marginTop); }
/** * Scale the image to the dimensions of the rectangle * * @param rectangle dimensions to scale the Image */ public void scaleAbsolute(final Rectangle rectangle) { scaleAbsolute(rectangle.getWidth(), rectangle.getHeight()); }
/** * Scales the images to the dimensions of the rectangle. * * @param rectangle the dimensions to fit */ public void scaleToFit(final Rectangle rectangle) { scaleToFit(rectangle.getWidth(), rectangle.getHeight()); }
private float widthPercent(FluentIterable<Tag> tags, ITextContext emitterContext) { Rectangle artBox = emitterContext.getDocumentArtBox(); Font font = headerCellStyler.cellFont(); BaseFont baseFont = font.getBaseFont(); float len = 0; for (Tag tag : tags) { float sLen = baseFont.getWidthPoint(tag.getTag(), font.getSize()); len = Math.max(len, sLen); } len = Math.min(artBox.getWidth() / 2, len); return len / artBox.getWidth(); }
private void drawBottomFrame(PdfAppearance app) { app.moveTo(borderWidth, borderWidth); app.lineTo(box.getWidth() - borderWidth, borderWidth); app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, 2 * borderWidth); app.lineTo(2 * borderWidth, 2 * borderWidth); app.lineTo(borderWidth, borderWidth); app.fill(); } /** Gets the border width in points.
private void drawBottomFrame(PdfAppearance app) { app.moveTo(borderWidth, borderWidth); app.lineTo(box.getWidth() - borderWidth, borderWidth); app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, 2 * borderWidth); app.lineTo(2 * borderWidth, 2 * borderWidth); app.lineTo(borderWidth, borderWidth); app.fill(); } /** Gets the border width in points.
public static void scaleToFit(Image img, Rectangle box) { float scaleWidth = box.getWidth() / img.getWidth(); float scaleHeight = box.getHeight() / img.getHeight(); float scale = Math.min(scaleHeight, scaleWidth); if (scale < 1) img.scalePercent(scale * 100f); }
public Rectangle(com.itextpdf.text.Rectangle r) { r.normalize(); setBounds(r.getLeft(), r.getBottom(), r.getWidth(), r.getHeight()); }
private void drawTopFrame(PdfAppearance app) { app.moveTo(borderWidth, borderWidth); app.lineTo(borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(2 * borderWidth, 2 * borderWidth); app.lineTo(borderWidth, borderWidth); app.fill(); }
private void drawTopFrame(PdfAppearance app) { app.moveTo(borderWidth, borderWidth); app.lineTo(borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - borderWidth, box.getHeight() - borderWidth); app.lineTo(box.getWidth() - 2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(2 * borderWidth, box.getHeight() - 2 * borderWidth); app.lineTo(2 * borderWidth, 2 * borderWidth); app.lineTo(borderWidth, borderWidth); app.fill(); }