安卓简易pdf阅读器的设计毕业论文(编辑修改稿)内容摘要:

在手机上无法查看的问题。 部分代码如下: package。 import。 第 19 页 import。 import。 import。 import。 import。 import。 import。 import。 public class PDFTextFormat implements Cloneable { /** character spacing */ private float tc = 0。 /** word spacing */ private float tw = 0。 /** horizontal scaling */ private float th = 1。 /** leading */ private float tl = 0。 /** rise amount */ private float tr = 0。 /** text mode */ private int tm =。 /** text knockout */ private float tk = 0。 /** current matrix transform */ private Matrix cur。 /** matrix transform at start of line */ private Matrix line。 /** font */ private PDFFont font。 /** font size */ private float fsize = 1。 /** are we between BT and ET? */ private boolean inuse = false。 // private Object array[]= new Object[1]。 第 20 页 /** build text rep of word */ private StringBuffer word = new StringBuffer()。 // this is where we build and keep the word list for this page. /** start location of the hunk of text */ private PointF wordStart。 /** location of the end of the previous hunk of text */ private PointF prevEnd。 /** * create a new PDFTextFormat, with initial values */ public PDFTextFormat() { cur = new Matrix()。 line = new Matrix()。 wordStart = new PointF(100, 100)。 prevEnd = new PointF(100, 100)。 tc = tw = tr = tk = 0。 tm =。 th = 1。 } /** * reset the PDFTextFormat for a new run */ public void reset() { ()。 ()。 inuse = true。 (0)。 } /** * end a span of text */ public void end() { inuse = false。 } 第 21 页 /** get the char spacing */ public float getCharSpacing() { return tc。 } /** set the character spacing */ public void setCharSpacing(float spc) { = spc。 } /** get the word spacing */ public float getWordSpacing() { return tw。 } /** set the word spacing */ public void setWordSpacing(float spc) { = spc。 } /** * Get the horizontal scale * @return the horizontal scale, in percent */ public float getHorizontalScale() { return th * 100。 } /** * set the horizontal scale. * @param scl the horizontal scale, in percent (100=normal) */ public void setHorizontalScale(float scl) { = scl / 100。 } /** get the leading */ public float getLeading() { return tl。 } 第 22 页 /** set the leading */ public void setLeading(float spc) { = spc。 } /** get the font */ public PDFFont getFont() { return font。 } /** get the font size */ public float getFontSize() { return fsize。 } /** set the font and size */ public void setFont(PDFFont f, float size) { = f。 = size。 } /** * Get the mode of the text */ public int getMode() { return tm。 } /** * set the mode of the text. The correspondence of m to mode is * show in the following table. m is a value from 07 in binary: * * 000 Fill * 001 Stroke * 010 Fill + Stroke * 011 Nothing * 100 Fill + Clip * 101 Stroke + Clip * 110 Fill + Stroke + Clip 第 23 页 * 111 Clip * * Therefore: Fill corresponds to the low bit being 0。 Clip * corresponds to the hight bit being 1。 and Stroke corresponds * to the middle xor low bit being 1. */ public void setMode(int m) { int mode = 0。 if ((m amp。 0x1) == 0) { mode |=。 } if ((m amp。 0x4) != 0) { mode |=。 } if (((m amp。 0x1) ^ ((m amp。 0x2) 1)) != 0) { mode |=。 } = mode。 } /** * Set the mode from another text format mode * * @param mode the text render mode using the * codes from PDFShapeCmd and not the wacky PDF codes */ public void setTextFormatMode(int mode) { = mode。 } /** * Get the rise */ public float getRise() { return tr。 } /** 第 24 页 * set the rise */ public void setRise(float spc) { = spc。 } /** * perform a carriage return */ public void carriageReturn() { carriageReturn(0, tl)。 } /** * perform a carriage return by translating by x and y. The next * carriage return will be relative to the new location. */ public void carriageReturn(float x, float y) { Matrix trans = new Matrix()。 (x, y)。 (trans)。 (line)。 } /** * Get the current transform */ public Matrix。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。