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

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

Introduction

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

Prototype

public PDColor getStrokingColor() 

Source Link

Document

Returns the 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  w  ww.j  ava2  s  .  com
    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;
}