Package com.lowagie.text

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


                    try {
                        Image img = TiffImage.getTiffImage(ra, c + 1);
                        if (img != null) {
                            System.out.println("page " + (c + 1));
                            if (img.getScaledWidth() > 500 || img.getScaledHeight() > 700) {
                                img.scaleToFit(500, 700);
                            }
                            img.setAbsolutePosition(20, 20);
                            document.add(new Paragraph(tiff_file + " - page " + (c + 1)));
                            cb.addImage(img);
                            document.newPage();
View Full Code Here

        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);
        } catch (BadElementException e) {
View Full Code Here

        checkIfDocIsClosed();

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

            File flef = new File(lo.getParent().concat("/xmlGraph_entrez.xml"));
            File flout = new File(lo.getParent().concat("/fullNetwork.png"));
            BufferedImage bufferedImg = util_GraphVisualizer.XMLBIF_to_Image(flef.getAbsolutePath(), lo.getParent().concat("/fullNetwork"),lookupFileName);
            Image img = Image.getInstance(flout.getAbsolutePath());
            img.setAlignment(Paragraph.ALIGN_CENTER);
            img.scaleToFit(500, 535);
            doc.newPage();
            doc.add(new Paragraph("Figure ".concat(String.valueOf(current_figureNumber)), title_f));
            doc.add(img);
            current_figureNumber++;
        }
View Full Code Here

                if (bufferedImg == null){continue;}
               
                File subnet = new File(lo.getParent().concat("/subsetNetwork_").concat(String.valueOf(i)).concat(".png"));
                Image img = Image.getInstance(subnet.getAbsolutePath());
                img.setAlignment(Paragraph.ALIGN_CENTER);
                img.scaleToFit(600, 640);
                Font ital = new Font();
                ital.setStyle(Font.ITALIC);
                doc.newPage();
                doc.add(new Paragraph("Figure ".concat(String.valueOf(current_figureNumber)).concat(": ").concat((String) DAVID_enrichment_results_ArrayList[i].get(enr_Wrapper.ARRAYLISTINDEX_term)), ital));
                doc.add(img);
View Full Code Here

        doc.newPage();
        doc.add(p2);
        doc.add(new Paragraph(new Chunk("Figure ".concat(String.valueOf(current_figureNumber-1)),itaFont)));
        File imageFile = new File(DAVID_enrichmentOverlapHeatmapFilename);
        Image img_heatmap = Image.getInstance(imageFile.getAbsolutePath());
        img_heatmap.scaleToFit(500, 500);
        img_heatmap.setAlignment(Paragraph.ALIGN_CENTER);
        doc.add(img_heatmap);
       
    }
   
View Full Code Here

        doc.newPage();
        doc.add(p2);
        doc.add(new Paragraph(new Chunk("Figure ".concat(String.valueOf(current_figureNumber-1)),itaFont)));
        File imageFile = new File(DAVID_enrichmentVennFilename);
        Image img_venn = Image.getInstance(imageFile.getAbsolutePath());
        img_venn.scaleToFit(500, 500);
        img_venn.setAlignment(Paragraph.ALIGN_CENTER);
        doc.add(img_venn);
       
    }
   
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.