Examples of scaleToFit()


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

                ColumnText ct2 = new ColumnText(t);
                ct2.setRunDirection(runDirection);
                ct2.setSimpleColumn(signatureRect.getLeft(), signatureRect.getBottom(), signatureRect.getRight(), signatureRect.getTop(), 0, Element.ALIGN_RIGHT);

                Image im = Image.getInstance(signatureGraphic);
                im.scaleToFit(signatureRect.getWidth(), signatureRect.getHeight());

                Paragraph p = new Paragraph();
                // must calculate the point to draw from to make image appear in middle of column
                float x = 0;
                // experimentation found this magic number to counteract Adobe's signature graphic, which
View Full Code Here

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

        float width = 0;
        float height = 0;
        try
        {
            Image image = Image.getInstance( new URL( urlName ) );
            image.scaleToFit( ITextUtil.getDefaultPageSize().width() / 2, ITextUtil.getDefaultPageSize().height() / 2 );
            width = image.plainWidth();
            height = image.plainHeight();
        }
        catch ( BadElementException e )
        {
View Full Code Here

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

        {
          currentContext.add(getText());
          clearText();
        }

        image.scaleToFit(targetWidth, targetHeight);
        currentContext.add(image);
      }
      else if (rawObject instanceof DrawableWrapper)
      {
        final StrictBounds rect = new StrictBounds
View Full Code Here

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

        if (getTextLength() > 0)
        {
          currentContext.add(getText());
          clearText();
        }
        image.scaleToFit(targetWidth, targetHeight);
        currentContext.add(image);
      }
    }
    catch (DocumentException ioe)
    {
View Full Code Here

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

            cb.moveTo(410, 525);
            cb.lineTo(410, 0);
            cb.stroke();
            if (getValue("front") != null) {
              Image front = (Image)getValue("front");
              front.scaleToFit(370, 525);
              front.setAbsolutePosition(410f + (370f - front.scaledWidth()) / 2f, (525f - front.scaledHeight()) / 2f);
              document.add(front);
            }
            if (getValue("back") != null) {
              Image back = (Image)getValue("back");
View Full Code Here

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

              front.setAbsolutePosition(410f + (370f - front.scaledWidth()) / 2f, (525f - front.scaledHeight()) / 2f);
              document.add(front);
            }
            if (getValue("back") != null) {
              Image back = (Image)getValue("back");
              back.scaleToFit(370, 525);
              back.setAbsolutePosition((370f - back.scaledWidth()) / 2f, (525f - back.scaledHeight()) / 2f);
              document.add(back);
            }
            if (getValue("side") != null) {
              Image side = (Image)getValue("side");
View Full Code Here

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

              back.setAbsolutePosition((370f - back.scaledWidth()) / 2f, (525f - back.scaledHeight()) / 2f);
              document.add(back);
            }
            if (getValue("side") != null) {
              Image side = (Image)getValue("side");
              side.scaleToFit(40, 525);
              side.setAbsolutePosition(370 + (40f - side.scaledWidth()) / 2f, (525f - side.scaledHeight()) / 2f);
              document.add(side);
            }

            // step 5: we close the document
View Full Code Here

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

                                float adjy = height / img.scaledHeight();
                                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);
                        document.newPage();
                        document.add(new Paragraph(tiff_file + " - page " + (c + 1)));
                  }
View Full Code Here

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

        checkIfDocIsClosed();

        try {
            Image pdfImage = Image.getInstance(image, null);
            pdfImage.setAbsolutePosition(0, 0);
            pdfImage.scaleToFit(width, height);
            PdfTemplate template = this.contentByte.createTemplate(image
                    .getWidth(), image.getHeight());
            template.addImage(pdfImage);
            this.contentByte.addTemplate(template, x, y);
        } catch (BadElementException e) {
View Full Code Here

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

        checkIfDocIsClosed();

        try {
            Image pdfImage = Image.getInstance(image, null);
            pdfImage.setAbsolutePosition(0, 0);
            pdfImage.scaleToFit(width, height);
            PdfTemplate template = this.contentByte.createTemplate(image
                    .getWidth(), image.getHeight());
            template.addImage(pdfImage);
            final float leftMargin = this.document.leftMargin();
            this.contentByte.addTemplate(template, leftMargin + x, y);
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.