/** * Sets the listsymbol. * <P> * This is a shortcut for <CODE>setListSymbol(Chunk symbol)</CODE>. * * @param symbol a <CODE>String</CODE> */ public void setListSymbol(final String symbol) { this.symbol = new Chunk(symbol); }
/** * Sets the listsymbol. * <P> * This is a shortcut for <CODE>setListSymbol(Chunk symbol)</CODE>. * * @param symbol a <CODE>String</CODE> */ public void setListSymbol(final String symbol) { this.symbol = new Chunk(symbol); }
@Deprecated public static Chunk createTabspace(float spacing) { Chunk tabspace = new Chunk(spacing, true); return tabspace; }
@Deprecated public static Chunk createTabspace(float spacing) { Chunk tabspace = new Chunk(spacing, true); return tabspace; }
/** * Adds a <CODE>String</CODE> to this <CODE>Phrase</CODE>. * * @param s a string * @return a boolean * @since 5.0.1 */ public boolean add(final String s) { if (s == null) { return false; } return super.add(new Chunk(s, font)); }
/** * Adds a <CODE>String</CODE> to this <CODE>Phrase</CODE>. * * @param s a string * @return a boolean * @since 5.0.1 */ public boolean add(final String s) { if (s == null) { return false; } return super.add(new Chunk(s, font)); }
/** * @see com.itextpdf.text.Element#getChunks() */ public List<Chunk> getChunks() { List<Chunk> list = new ArrayList<Chunk>(); list.add(new Chunk(this, true)); return list; }
/** * @see com.itextpdf.text.Element#getChunks() */ public List<Chunk> getChunks() { List<Chunk> list = new ArrayList<Chunk>(); list.add(new Chunk(this, true)); return list; }
private static Element discardNewline(Element sub) { if (sub instanceof Chunk) { Chunk c = (Chunk) sub; String content = c.getContent(); if (content.endsWith("\n") && content.length() < 2) { return new Chunk(" "); } } return sub; }
protected void emitText(ITextContext context, StringBuilder b, Font font) { if (b.length() == 0) return; context.append(new Chunk(b.toString(), font)); } }
/** * Returns a formatted cell for the given value. * @param value cell value * @return Cell */ private PdfPCell getCell(String value) { PdfPCell cell = new PdfPCell(new Phrase(new Chunk(StringUtils.trimToEmpty(value), this.smallFont))); cell.setVerticalAlignment(Element.ALIGN_TOP); cell.setLeading(8, 0); cell.setPadding(2); return cell; }
public Chunk symbol(String name, float size, BaseColor fg) { String s = fontAwesome.get(name); if(s==null) throw new IllegalArgumentException("Unrecognized symbol '" + name + "'"); return new Chunk(s, new Font(baseFont, size, Font.NORMAL, fg)); }
@Override public void process(int level, Node node, InvocationContext context) { TextNode tNode = (TextNode) node; context.append(new Chunk(tNode.getText(), context.peekFont())); } }
@Override public void process(int level, Node node, InvocationContext context) { SpecialTextNode tNode = (SpecialTextNode) node; context.append(new Chunk(tNode.getText(), context.peekFont())); } }
/** * Writes the table caption according to a set style. * @param model The table model containing the caption. * @throws DocumentException If an error occurrs while decorating the caption. */ private void decorateCaption(TableModel model) throws DocumentException { Paragraph caption = new Paragraph(new Chunk(model.getCaption(), this.getCaptionFont())); caption.setAlignment(this.getCaptionHorizontalAlignment()); this.document.add(caption); }
private Chunk connectChunk(Styles styles) { return new Chunk(new LineSeparator(0.5f, 95, styles.defaultColor(), Element.ALIGN_CENTER, -.5f)); } }
protected Paragraph formatTitle(int headerLevel, ITextContext emitterContext, BackgroundExec background) { Styles styles = emitterContext.styles(); Font font = styles.sectionTitleFontForLevel(headerLevel + 1); Paragraph p = new Paragraph(); p.add(new Chunk(background.name(), font)); p.add(new Chunk(" (", font)); p.add(new Chunk(background.keyword(), new FontCopier(font).italic().color(styles.getColor(KEYWORD_COLOR).or(BaseColor.LIGHT_GRAY)).get())); p.add(new Chunk(")", font)); return p; }
public Chunk bulletSymbol() { if(bulletSymbol==null) bulletSymbol = new Chunk("• ", new FontCopier(getSymbolFont()).size(10f).get()); return bulletSymbol; } }