Example usage for org.apache.pdfbox.pdmodel.graphics.state PDGraphicsState getNonStrokingColor

List of usage examples for org.apache.pdfbox.pdmodel.graphics.state PDGraphicsState getNonStrokingColor

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.graphics.state PDGraphicsState getNonStrokingColor.

Prototype

public PDColor getNonStrokingColor() 

Source Link

Document

Returns the non-stroking color.

Usage

From source file:com.tekstosense.segmenter.data.Text.java

License:Open Source License

public static Text newFor(TextPosition tp, PDGraphicsState gs, String text) {
    Text t = new Text();
    t.x = tp.getXDirAdj();/*from www.  j ava 2s .  co m*/
    t.baseline = tp.getYDirAdj();
    t.font = tp.getFont();
    t.strokeColor = gs.getStrokingColor();
    t.nonStrokeColor = gs.getNonStrokingColor();
    t.run = tp.getUnicode();
    t.width = tp.getWidth();
    t.height = tp.getHeight();
    t.pointSize = tp.getFontSizeInPt();
    t.fontSize = tp.getYScale();
    t.tempRun = t.run;

    // Bump the width by the word spacing for each space in tp.
    /*      for (int i=0; i<tp.getCharacter().length(); i++) {
              Character c = tp.getCharacter().charAt(i);
              if (c.equals(" ")) {
    t.width -= tp.getWidthOfSpace();
      t.width += tp.getWordSpacing();
              }
          }
    */
    return t;
}