List of usage examples for org.apache.pdfbox.text TextPosition getYScale
public float getYScale()
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 ww w .j a v a 2s . c o 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; }