Package com.itextpdf.text

Examples of com.itextpdf.text.Chunk


        carriageReturn();
      }
      if (currentParagraph == null) {
        currentParagraph = createParagraph();
      }
      currentParagraph.add(new Chunk(img, 0, 0, true));
      currentParagraph.setAlignment(HtmlUtilities.alignmentValue(align));
      if (align != null) {
        carriageReturn();
      }
    }
View Full Code Here


   * @param chain the hierarchy chain
   * @return a Chunk
   */
  public Chunk createChunk(final String content, final ChainedProperties chain) {
    Font font = getFont(chain);
    Chunk ck = new Chunk(content, font);
    if (chain.hasProperty(HtmlTags.SUB))
      ck.setTextRise(-font.getSize() / 2);
    else if (chain.hasProperty(HtmlTags.SUP))
      ck.setTextRise(font.getSize() / 2);
    ck.setHyphenation(getHyphenation(chain));
    return ck;
  }
View Full Code Here

    /**
     * @see com.itextpdf.text.Element#getChunks()
     */
    public List<Chunk> getChunks() {
      List<Chunk> list = new ArrayList<Chunk>();
      list.add(new Chunk(this, true));
        return list;
    }
View Full Code Here

    }

    private Phrase composePhrase(String text, BaseFont ufont, BaseColor color, float fontSize) {
        Phrase phrase = null;
        if (extensionFont == null && (substitutionFonts == null || substitutionFonts.isEmpty()))
            phrase = new Phrase(new Chunk(text, new Font(ufont, fontSize, 0, color)));
        else {
            FontSelector fs = new FontSelector();
            fs.addFont(new Font(ufont, fontSize, 0, color));
            if (extensionFont != null)
                fs.addFont(new Font(extensionFont, fontSize, 0, color));
View Full Code Here

                    app.setGrayFill(0);
                else
                    app.setColorFill(textColor);
                app.beginText();
                for (int k = 0; k < phrase.size(); ++k) {
                    Chunk ck = (Chunk)phrase.get(k);
                    BaseFont bf = ck.getFont().getBaseFont();
                    app.setFontAndSize(bf, usize);
                    StringBuffer sb = ck.append("");
                    for (int j = 0; j < sb.length(); ++j) {
                        String c = sb.substring(j, j + 1);
                        float wd = bf.getWidthPoint(c, usize);
                        app.setTextMatrix(extraMarginLeft + start - wd / 2, offsetY - extraMarginTop);
                        app.showText(c);
View Full Code Here

     * @return Returns the Chunk.
     */
    public Chunk create(final String text, final String in1, final String in2,
            final String in3) {

        Chunk chunk = new Chunk(text);
        String tag = "idx_" + indexcounter++;
        chunk.setGenericTag(tag);
        chunk.setLocalDestination(tag);
        Entry entry = new Entry(in1, in2, in3, tag);
        indexentry.add(entry);
        return chunk;
    }
View Full Code Here

            int style = f.getStyle();
            style &= ~Font.UNDERLINE;
            style &= ~Font.STRIKETHRU;
            f.setStyle(style);
        }
        Chunk space = new Chunk(" ", f);
        space.process(this);
        carriageReturn();
        leading = oldleading;
    }
View Full Code Here

     */
    public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open) {
        super();
        StringBuffer buf = new StringBuffer();
        for (Object element : title.getChunks()) {
            Chunk chunk = (Chunk) element;
            buf.append(chunk.getContent());
        }
        this.destination = destination;
        initOutline(parent, buf.toString(), open);
    }
View Full Code Here

            final boolean hasStatements = scriptCoverageStatistics.getHasStatements();

            final Phrase fileName = new Phrase();

            if (scriptCoverageStatistics.getParentName() != null) {
                fileName.add(new Chunk(scriptCoverageStatistics.getParentName() + "/", hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
                fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD_BOLD : FONT_TD_BOLD_EMPTY_FILE));
            } else {
                fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
            }

            final BaseColor bgColor = (i % 2 == 1) ? COLOR_ROW_ODD : COLOR_ROW_EVEN;

            final Font font = FONT_TD;
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Chunk

Copyright © 2018 www.massapicom. 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.