Examples of scaleAbsolute()


Examples of com.lowagie.text.Image.scaleAbsolute()

                    if (dpiX == 0) dpiX=72;
                    dpiY=img.getDpiY();
                    if (dpiY == 0) dpiY=72;
                    imgWidthPica=(72*img.plainWidth()) / dpiX;
                    imgHeightPica=(72*img.plainHeight()) / dpiY;
                    img.scaleAbsolute(imgWidthPica,imgHeightPica);
                    document.setPageSize(new Rectangle(imgWidthPica, imgHeightPica));
                  if (document.isOpen()) {
                    document.newPage();
                  }
                  else {
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

            Document pdfDocument = new Document();
            PdfWriter docWriter = PdfWriter.getInstance(pdfDocument, new FileOutputStream(tmpFile));
            pdfDocument.open();
            Image jpg = Image.getInstance(imageFile.getPath());
            jpg.setRotation(new Double(Math.PI/2).floatValue());
            jpg.scaleAbsolute(770, 520);
            pdfDocument.add(jpg);
            pdfDocument.close();
            docWriter.close();
            maptmpfile = tmpFile;
         
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

            Document pdfDocument = new Document();
            PdfWriter docWriter = PdfWriter.getInstance(pdfDocument, new FileOutputStream(tmpFile));
            pdfDocument.open();
            Image jpg = Image.getInstance(imageFile.getPath());
            jpg.setRotation(new Double(Math.PI/2).floatValue());
            jpg.scaleAbsolute(770, 520);
            pdfDocument.add(jpg);
            pdfDocument.close();
            docWriter.close();
            maptmpfile = tmpFile;
         
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

                input = new URL(builder.toString()).openStream();
                byte[] bytes = IOUtils.toByteArray(input);
                Image image = Image.getInstance(bytes);

                float factor = layoutContext.getDotsPerPixel();
                image.scaleAbsolute(image.getPlainWidth() * factor, image.getPlainHeight() * factor);
                FSImage fsImage = new ITextFSImage(image);
               
                if(cssHeight > -1 && cssWidth > -1) {
                    fsImage.scale(cssWidth, cssHeight);
                }
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

      //          e1.printStackTrace();
      //        }

      // set the image attributes

      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());
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

      // set the image attributes

      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 {
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

                    if (dpiY == 0) {
                        dpiY = 72;
                    }
                    imgWidthPica = (72 * img.getPlainWidth()) / dpiX;
                    imgHeightPica = (72 * img.getPlainHeight()) / dpiY;
                    img.scaleAbsolute(imgWidthPica, imgHeightPica);
                    document.setPageSize(new Rectangle(imgWidthPica,
                            imgHeightPica));
                    if (document.isOpen()) {
                        document.newPage();
                    } else {
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

                        Image bmp = BmpImage.getImage(inb, true, b.length);
                        cb.saveState();
                        cb.rectangle(xDest, yDest, destWidth, destHeight);
                        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);
                        cb.restoreState();
                    }
                    catch (Exception e) {
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

                        Image bmp = BmpImage.getImage(inb, true, b.length);
                        cb.saveState();
                        cb.rectangle(xDest, yDest, destWidth, destHeight);
                        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);
                        cb.restoreState();
                    }
                    catch (Exception e) {
View Full Code Here

Examples of com.lowagie.text.Image.scaleAbsolute()

                        Image bmp = BmpImage.getImage(inb, true, b.length);
                        cb.saveState();
                        cb.rectangle(xDest, yDest, destWidth, destHeight);
                        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);
                        cb.restoreState();
                    }
                    catch (Exception e) {
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.