float getImageHeight() { return image.getScaledHeight() * imageScalePercentage; }
float getImageHeight() { return image.getScaledHeight() * imageScalePercentage; }
/** * Scales the image so that it fits a certain width and height. * * @param fitWidth * the width to fit * @param fitHeight * the height to fit */ public void scaleToFit(final float fitWidth, final float fitHeight) { scalePercent(100); float percentX = fitWidth * 100 / getScaledWidth(); float percentY = fitHeight * 100 / getScaledHeight(); scalePercent(percentX < percentY ? percentX : percentY); setWidthPercentage(0); }
/** * Scales the image so that it fits a certain width and height. * * @param fitWidth * the width to fit * @param fitHeight * the height to fit */ public void scaleToFit(final float fitWidth, final float fitHeight) { scalePercent(100); float percentX = fitWidth * 100 / getScaledWidth(); float percentY = fitHeight * 100 / getScaledHeight(); scalePercent(percentX < percentY ? percentX : percentY); setWidthPercentage(0); }
(documentRect.getHeight() - image.getScaledHeight()) / 2);
document.setPageSize(new Rectangle(image.getScaledWidth(), image.getScaledHeight())); document.newPage(); image.setAbsolutePosition(0, 0);
float h = Math.min(img.getScaledHeight(), 300); for (float f : img.matrix()) { System.out.println(f);
if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { if (!strictImageSequence && imageWait == null) { imageWait = image; if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { imageWait = image; return; diff += leading; float lowerleft = indentTop() - currentHeight - image.getScaledHeight() -diff; float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if (image.hasAbsoluteX()) startPosition = image.getAbsoluteX(); if (textwrap) { if (imageEnd < 0 || imageEnd < currentHeight + image.getScaledHeight() + diff) { imageEnd = currentHeight + image.getScaledHeight() + diff; currentHeight += image.getScaledHeight() + diff; flushLines(); text.moveText(0, - (image.getScaledHeight() + diff)); newLine();
if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { if (!strictImageSequence && imageWait == null) { imageWait = image; if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { imageWait = image; return; diff += leading; float lowerleft = indentTop() - currentHeight - image.getScaledHeight() -diff; float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if (image.hasAbsoluteX()) startPosition = image.getAbsoluteX(); if (textwrap) { if (imageEnd < 0 || imageEnd < currentHeight + image.getScaledHeight() + diff) { imageEnd = currentHeight + image.getScaledHeight() + diff; currentHeight += image.getScaledHeight() + diff; flushLines(); text.moveText(0, - (image.getScaledHeight() + diff)); newLine();
document = new Document(new RectangleReadOnly(image.getScaledWidth(), image.getScaledHeight()));
image.setAbsolutePosition( (documentRect.getWidth() - image.getScaledWidth()) / 2, (documentRect.getHeight() - image.getScaledHeight()) / 2); document.add(image);
if (ck.isImage() && minY < yLine) { Image img = ck.getImage(); if (img.isScaleToFitHeight() && yLine + 2 * descender - img.getScaledHeight() - ck.getImageOffsetY() - img.getSpacingBefore() < minY) { float scalePercent = (yLine + 2 * descender - ck.getImageOffsetY() - img.getSpacingBefore() - minY) / img.getScaledHeight(); ck.setImageScalePercentage(scalePercent);
if (ck.isImage() && minY < yLine) { Image img = ck.getImage(); if (img.isScaleToFitHeight() && yLine + 2 * descender - img.getScaledHeight() - ck.getImageOffsetY() - img.getSpacingBefore() < minY) { float scalePercent = (yLine + 2 * descender - ck.getImageOffsetY() - img.getSpacingBefore() - minY) / img.getScaledHeight(); ck.setImageScalePercentage(scalePercent);
float y = -im.getScaledHeight() + 15; y = y - (signatureRect.getHeight() - im.getScaledHeight()) / 2; p.add(new Chunk(im, x + (signatureRect.getWidth() - im.getScaledWidth()) / 2, y, false)); ct2.addElement(p); y = (signatureRect.getHeight() - im.getScaledHeight()) / 2; p.add(new Chunk(im, x, y, false)); ct2.addElement(p);
float y = -im.getScaledHeight() + 15; y = y - (signatureRect.getHeight() - im.getScaledHeight()) / 2; p.add(new Chunk(im, x + (signatureRect.getWidth() - im.getScaledWidth()) / 2, y, false)); ct2.addElement(p); y = (signatureRect.getHeight() - im.getScaledHeight()) / 2; p.add(new Chunk(im, x, y, false)); ct2.addElement(p);
if (img != null) { img.scalePercent(100); float refWidth = pivoted ? img.getScaledHeight() : img.getScaledWidth(); float scale = (getRight() - getEffectivePaddingRight() - getEffectivePaddingLeft() - getLeft()) / refWidth; img.scalePercent(scale * 100); float refHeight = pivoted ? img.getScaledWidth() : img.getScaledHeight(); setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - refHeight); } else {
if (img != null) { img.scalePercent(100); float refWidth = pivoted ? img.getScaledHeight() : img.getScaledWidth(); float scale = (getRight() - getEffectivePaddingRight() - getEffectivePaddingLeft() - getLeft()) / refWidth; img.scalePercent(scale * 100); float refHeight = pivoted ? img.getScaledWidth() : img.getScaledHeight(); setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - refHeight); } else {
if (img != null) { float padding = cell.getEffectivePaddingBottom() + cell.getEffectivePaddingTop() + 2; if ((img.isScaleToFitHeight() || img.getScaledHeight() + padding < newHeight) && newHeight > padding) { newCell.setPhrase(null);
if (img != null) { float padding = cell.getEffectivePaddingBottom() + cell.getEffectivePaddingTop() + 2; if ((img.isScaleToFitHeight() || img.getScaledHeight() + padding < newHeight) && newHeight > padding) { newCell.setPhrase(null);
float scale = (currentMaxHeight - cell.getEffectivePaddingTop() - cell .getEffectivePaddingBottom()) / img.getScaledHeight(); img.scalePercent(scale * 100); vf = true; img.setAbsolutePosition(left, tly - img.getScaledHeight()); try { if (isTagged(canvases[PdfPTable.TEXTCANVAS])) {