Codota Logo
Chunk.setTextRise
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain Chunk
private void myMethod () {
Chunk c =
  • Codota IconString content;Font font;new Chunk(content, font)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 public Chunk addSuperscript(String text) {
 float leading = determineCurrentLeading();
 Font f = determineCurrentFont();
 Font supFont = new Font(f);
 supFont.setSize(f.getSize() / 2f);
 Chunk c = new Chunk(text, supFont);
 c.setTextRise(leading / 2f);
 return c;
}
origin: stackoverflow.com

 Paragraph p = new Paragraph();
Chunk smallChunk = new Chunk("small middle", BLUE);
smallChunk.setTextRise( (15 - 6) / 2);
p.add(smallChunk);
p.add(new Chunk("big middle", RED));
origin: stackoverflow.com

chunk.setTextRise(8);
origin: com.itextpdf/itextpdf

/**
 * Creates an iText Chunk
 * @param content the content of the Chunk
 * @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;
}
origin: com.itextpdf/itextg

/**
 * Creates an iText Chunk
 * @param content the content of the Chunk
 * @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;
}
com.itextpdf.textChunksetTextRise

Javadoc

Sets the text displacement relative to the baseline. Positive values rise the text, negative values lower the text.

It can be used to implement sub/superscript.

Popular methods of Chunk

  • <init>
    Constructs a chunk of text with a certain content and a certain Font.
  • setBackground
    Sets the color and the size of the background Chunk.
  • 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.
  • append
    appends some text to this Chunk.
  • createTabspace
  • createWhitespace
  • getAccessibleAttribute
  • createWhitespace,
  • getAccessibleAttribute,
  • getAccessibleAttributes,
  • getAttributes,
  • getHorizontalScaling,
  • getHyphenation,
  • getId,
  • getImage,
  • getRole

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • 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
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • ImageIO (javax.imageio)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now