Tabnine Logo
Image.scaleAbsolute
Code IndexAdd Tabnine to your IDE (free)

How to use
scaleAbsolute
method
in
com.itextpdf.text.Image

Best Java code snippets using com.itextpdf.text.Image.scaleAbsolute (Showing top 14 results out of 315)

origin: com.itextpdf/itextg

/**
 * 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());
}
origin: com.itextpdf/itextpdf

/**
 * 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());
}
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

public void scale(int width, int height) {
  if (width > 0 || height > 0) {
    int currentWith = getWidth();
    int currentHeight = getHeight();
    int targetWidth = width;
    int targetHeight = height;
    if (targetWidth == -1) {
      targetWidth = (int)(currentWith * ((double)targetHeight / currentHeight));
    }
    if (targetHeight == -1) {
      targetHeight = (int)(currentHeight * ((double)targetWidth / currentWith));
    }
    if (currentWith != targetWidth || currentHeight != targetHeight) {
      _image.scaleAbsolute(targetWidth, targetHeight);
    }
  }
}
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

private void scaleToOutputResolution(Image image) {
  float factor = _sharedContext.getDotsPerPixel();
  if (factor != 1.0f) {
    image.scaleAbsolute(image.getPlainWidth() * factor, image.getPlainHeight() * factor);
  }
}
origin: it.innove/play2-pdf

private void scaleToOutputResolution(Image image) {
  float factor = getSharedContext().getDotsPerPixel();
  image.scaleAbsolute(image.getPlainWidth() * factor, image.getPlainHeight() * factor);
}
origin: com.itextpdf/itextpdf

float heightInPoints = HtmlUtilities.parseLength(height, actualFontSize);
if (widthInPoints > 0 && heightInPoints > 0) {
  img.scaleAbsolute(widthInPoints, heightInPoints);
} else if (widthInPoints > 0) {
  heightInPoints = img.getHeight() * widthInPoints
      / img.getWidth();
  img.scaleAbsolute(widthInPoints, heightInPoints);
} else if (heightInPoints > 0) {
  widthInPoints = img.getWidth() * heightInPoints
      / img.getHeight();
  img.scaleAbsolute(widthInPoints, heightInPoints);
origin: com.itextpdf/itextg

float heightInPoints = HtmlUtilities.parseLength(height, actualFontSize);
if (widthInPoints > 0 && heightInPoints > 0) {
  img.scaleAbsolute(widthInPoints, heightInPoints);
} else if (widthInPoints > 0) {
  heightInPoints = img.getHeight() * widthInPoints
      / img.getWidth();
  img.scaleAbsolute(widthInPoints, heightInPoints);
} else if (heightInPoints > 0) {
  widthInPoints = img.getWidth() * heightInPoints
      / img.getHeight();
  img.scaleAbsolute(widthInPoints, heightInPoints);
origin: Swati4star/Images-to-PDF

  image.scaleToFit(pageWidth, pageHeight);
else
  image.scaleAbsolute(pageWidth, pageHeight);
origin: org.technbolts/gutenberg

public static void adjustOrScaleToFit(Image img, Dimension dim, Rectangle box) {
  if (dim == null) {
    scaleToFit(img, box);
    return;
  }
  float width = img.getWidth();
  switch (dim.unit()) {
    case Percent:
      width = box.getWidth() * dim.amount() / 100f;
      break;
    case Px:
      width = dim.amount();
      break;
  }
  // W --> w
  // H --> h  •••> h = w * H / W
  float height = width * img.getHeight() / img.getWidth();
  img.scaleAbsolute(width, height);
}
origin: com.itextpdf/itextg

  backgroundImage.scaleToFit(background);
} else {
  backgroundImage.scaleAbsolute(backgroundImageWidth, backgroundImageHeight);
origin: com.itextpdf/itextpdf

  backgroundImage.scaleToFit(background);
} else {
  backgroundImage.scaleAbsolute(backgroundImageWidth, backgroundImageHeight);
origin: grakic/jfreesteel

image.setBorder(Image.BOX);
image.setBorderWidth(1f);
image.scaleAbsolute(119, 158);
writer.getDirectContent().addImage(image);
origin: com.itextpdf/itextg

cb.clip();
cb.newPath();
bmp.scaleAbsolute(destWidth * bmp.getWidth() / srcWidth, -destHeight * bmp.getHeight() / srcHeight);
bmp.setAbsolutePosition(xDest - destWidth * xSrc / srcWidth, yDest + destHeight * ySrc / srcHeight - bmp.getScaledHeight());
cb.addImage(bmp);
origin: com.itextpdf/itextpdf

cb.clip();
cb.newPath();
bmp.scaleAbsolute(destWidth * bmp.getWidth() / srcWidth, -destHeight * bmp.getHeight() / srcHeight);
bmp.setAbsolutePosition(xDest - destWidth * xSrc / srcWidth, yDest + destHeight * ySrc / srcHeight - bmp.getScaledHeight());
cb.addImage(bmp);
com.itextpdf.textImagescaleAbsolute

Javadoc

Scale the image to an absolute width and an absolute height.

Popular methods of Image

  • getInstance
    gets an instance of an Image
  • getHeight
  • getWidth
  • setAbsolutePosition
    Sets the absolute position of the Image.
  • getScaledHeight
    Gets the scaled height of the image.
  • getScaledWidth
    Gets the scaled width of the image.
  • scaleToFit
    Scales the images to the dimensions of the rectangle.
  • scalePercent
    Scale the width and height of an image to a certain percentage.
  • getICCProfile
    Gets the images ICC profile.
  • makeMask
    Make this Image a mask.
  • matrix
    Returns the transformation matrix of the image.
  • setImageMask
    Sets the explicit masking.
  • matrix,
  • setImageMask,
  • setRotation,
  • getAbsoluteX,
  • getAbsoluteY,
  • getAccessibleAttribute,
  • getAccessibleAttributes,
  • getAdditional,
  • getAlignment

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now