Examples of scalePercent()


Examples of com.lowagie.text.LwgImage.scalePercent()

                    if (img.getScaledWidth() > width || img.getScaledHeight() > height) {
                            if (img.getDpiX() > 0 && img.getDpiY() > 0) {
                                float adjx = width / img.getScaledWidth();
                                float adjy = height / img.getScaledHeight();
                                float adj = Math.min(adjx, adjy);
                                img.scalePercent(7200f / img.getDpiX() * adj, 7200f / img.getDpiY() * adj);
                            }
                            else
                                img.scaleToFit(width, height);
                    }
                    img.setAbsolutePosition(20, 20);
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

      img.scaleAbsolute(this.desiredWidth.floatValue()
          / PIXEL_TWIPS_FACTOR, this.desiredHeight.floatValue()
          / PIXEL_TWIPS_FACTOR);
      img.scaleAbsolute(this.width.floatValue() / PIXEL_TWIPS_FACTOR,
          this.height.floatValue() / PIXEL_TWIPS_FACTOR);
      img.scalePercent(this.scaleX.floatValue(), this.scaleY.floatValue());
      //        img.setBorder(value);

      try {
        if (this.rtfParser.isImport()) {
          LwgDocument doc = this.rtfParser.getDocument();
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

            document.add(p1);
            document.add(table);
            Paragraph p2 = new Paragraph("More templates ");
            p2.setLeading(img.getScaledHeight() * 1.1f);
            p2.setAlignment(LwgElement.ALIGN_JUSTIFIED);
            img.scalePercent(70);
            for (int k = 0; k < 20; ++k)
                p2.add(ck);
            document.add(p2);
            // step 5: we close the document
            document.close();
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

      boolean isPivoted = (getRotation() == 90 || getRotation() == 270);
      LwgImage img = getImage();
     
      if (img != null)
      {
         img.scalePercent(100);
         float fltRefWidth = isPivoted ? img.getScaledHeight() : img.getScaledWidth();
        
         float scale = (getRight() - getEffectivePaddingRight()
               - getEffectivePaddingLeft() - getLeft()) / fltRefWidth;
        
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

         float fltRefWidth = isPivoted ? img.getScaledHeight() : img.getScaledWidth();
        
         float scale = (getRight() - getEffectivePaddingRight()
               - getEffectivePaddingLeft() - getLeft()) / fltRefWidth;
        
         img.scalePercent(scale * 100);
         float fltRefHeight = isPivoted ? img.getScaledWidth() : img.getScaledHeight();
        
         setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - fltRefHeight);
      }
      else
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

                    img = LwgImage.getInstance(img);
                    img.setRotation(img.getImageRotation() + (float)(cell.getRotation() * Math.PI / 180.0));
                }
        boolean vf = false;
        if (cell.getHeight() > currentMaxHeight) {
          img.scalePercent(100);
          float scale = (currentMaxHeight - cell.getEffectivePaddingTop() - cell
              .getEffectivePaddingBottom())
              / img.getScaledHeight();
          img.scalePercent(scale * 100);
          vf = true;
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

        if (cell.getHeight() > currentMaxHeight) {
          img.scalePercent(100);
          float scale = (currentMaxHeight - cell.getEffectivePaddingTop() - cell
              .getEffectivePaddingBottom())
              / img.getScaledHeight();
          img.scalePercent(scale * 100);
          vf = true;
        }
        float left = cell.getLeft() + xPos
            + cell.getEffectivePaddingLeft();
        if (vf) {
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

            PdfWriter.getInstance(document, new FileOutputStream("imageChunks.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: we create a table and add it to the document
            LwgImage img = LwgImage.getInstance("pngnow.png");
            img.scalePercent(70);
            Chunk ck = new Chunk(img, 0, -5);
            LwgPdfPTable table = new LwgPdfPTable(3);
            LwgPdfPCell cell = new LwgPdfPCell();
            cell.addElement(new Chunk(img, 5, -5));
            cell.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0));
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

            pdf417.setText(text);
            LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("pdf417.pdf"));
            document.open();
            LwgImage img = pdf417.getImage();
            img.scalePercent(50, 50 * pdf417.getYHeight());
            document.add(img);
            document.close();
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of com.lowagie.text.LwgImage.scalePercent()

            LwgImage jpg1 = LwgImage.getInstance("otsoe.jpg");
            jpg1.scaleAbsolute(160, 120);
            document.add(new Paragraph("scaleAbsolute(160, 120)"));
            document.add(jpg1);
            LwgImage jpg2 = LwgImage.getInstance("otsoe.jpg");
            jpg2.scalePercent(50);
            document.add(new Paragraph("scalePercent(50)"));
            document.add(jpg2);
            LwgImage jpg3 = LwgImage.getInstance("otsoe.jpg");
            jpg3.scaleAbsolute(320, 120);
            document.add(new Paragraph("scaleAbsolute(320, 120)"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.