Tabnine Logo
Chunk.setBackground
Code IndexAdd Tabnine to your IDE (free)

How to use
setBackground
method
in
com.itextpdf.text.Chunk

Best Java code snippets using com.itextpdf.text.Chunk.setBackground (Showing top 10 results out of 315)

origin: com.itextpdf/itextpdf

/**
 * Sets the color of the background <CODE>Chunk</CODE>.
 *
 * @param color
 *            the color of the background
 * @return this <CODE>Chunk</CODE>
 */
public Chunk setBackground(final BaseColor color) {
  return setBackground(color, 0, 0, 0, 0);
}
origin: com.itextpdf/itextg

/**
 * Sets the color of the background <CODE>Chunk</CODE>.
 *
 * @param color
 *            the color of the background
 * @return this <CODE>Chunk</CODE>
 */
public Chunk setBackground(final BaseColor color) {
  return setBackground(color, 0, 0, 0, 0);
}
origin: stackoverflow.com

 Font font = new Font(FontFamily.HELVETICA, 6, Font.BOLD, BaseColor.WHITE);
Chunk id = new Chunk("Text", font);
// with a background color
id.setBackground(BaseColor.BLACK, 1f, 0.5f, 1f, 1.5f);
origin: stackoverflow.com

 Font f = new Font(FontFamily.TIMES_ROMAN, 25.0f, Font.BOLD, BaseColor.WHITE);
Chunk c = new Chunk("Total Cost:" + dbsumcallcost, f);
c.setBackground(BaseColor.RED);
Paragraph p = new Paragraph(c);
document.add(p);
origin: stackoverflow.com

 Font f3 = new Font(Font.FontFamily.TIMES_ROMAN, 18.0f, Font.BOLD, BaseColor.BLACK);
Chunk c3 = new Chunk("INVOICE", f3);
c3.setBackground(BaseColor.WHITE);       
Paragraph p3 = new Paragraph(c3);
p3.setAlignment(Element.ALIGN_CENTER);
origin: stackoverflow.com

 Chunk textAsChunk = new Chunk(text, textFont);
textAsChunk.setBackground(new BaseColor(120, 200, 50));

ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new Phrase(textAsChunk), x, y, 0);
origin: org.technbolts/gutenberg

@Override
public void process(int level, Node node, InvocationContext context) {
  CodeNode cNode = (CodeNode) node;
  Font font = styles.getFont(Styles.INLINE_CODE_FONT).or(inlineCodeFont(styles));
  List<Element> elements = context.iTextContext().emitButCollectElements(new RichText(cNode.getText(), font));
  for (Element element : elements) {
    if (element instanceof Chunk) {
      Chunk chunk = (Chunk) element;
      chunk.setBackground(styles.getColor(Styles.INLINE_CODE_BACKGROUND).or(BaseColor.GRAY));
      chunk.setGenericTag("code");
    }
    context.append(element);
  }
}
origin: dariober/ASCIIGenome

nChars += 1;
Chunk chunk= new Chunk(c, new Font(Font.FontFamily.COURIER, fontSize, Font.NORMAL, fgBaseCol));
chunk.setBackground(bgBaseCol);
pdfLine.add(chunk);
origin: org.technbolts.tzatziki/tzatziki-pdf

regexChunk.setBackground(regexBg);
origin: org.technbolts/gutenberg

public List<Element> process(SourceCode sourceCode) {
  String lang = sourceCode.lang();
  String content = sourceCode.content();
  boolean linenos = sourceCode.showLineNumbers();
  Tokens tokens = pygments.tokenize(lang, content);
  Paragraph p = new Paragraph();
  for (TokenWithValue token : tokens) {
    Style style = styleSheet.styleOf(token.token);
    BaseColor color = toColor(style.fg());
    int s = calculateStyle(style);
    Font font = styles.getFont(Styles.CODE_FONT, s, color).get();
    Chunk o = new Chunk(token.value, font);
    RGB bg = style.bg();
    if (bg != null)
      o.setBackground(toColor(bg));
    p.add(o);
  }
  PdfPCell cell = new PdfPCell(p);
  cell.setPaddingBottom(5.0f);
  cell.setBorder(Rectangle.NO_BORDER);
  PdfPTable table = new PdfPTable(1);
  table.addCell(cell);
  table.setSpacingBefore(5.0f);
  table.setSpacingAfter(5.0f);
  table.setTableEvent(new TableBackground(toColor(styleSheet.backgroundColor())));
  return Arrays.<Element>asList(table);
}
com.itextpdf.textChunksetBackground

Javadoc

Sets the color of the background Chunk.

Popular methods of Chunk

  • <init>
    Constructs a chunk of text with a certain content and a certain Font.
  • getContent
    Returns the content of this Chunk.
  • getWidthPoint
    Gets the width of the Chunk in points.
  • setGenericTag
    Sets the generic tag Chunk. The text for this tag can be retrieved with PdfPageEvent.
  • getFont
    Gets the font of this Chunk.
  • setFont
    Sets the font of this Chunk.
  • setLocalDestination
    Sets a local destination for this Chunk.
  • setTextRise
    Sets the text displacement relative to the baseline. Positive values rise the text, negative values
  • append
    appends some text to this Chunk.
  • createTabspace
  • createWhitespace
  • getAccessibleAttribute
  • createWhitespace,
  • getAccessibleAttribute,
  • getAccessibleAttributes,
  • getAttributes,
  • getHorizontalScaling,
  • getHyphenation,
  • getId,
  • getImage,
  • getRole

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JButton (javax.swing)
  • JLabel (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now