亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pdfchunk.java

?? iText可以制作中文PDF文件的JAVA源程序最新版下載
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * $Id: PdfChunk.java,v 1.43 2002/11/19 08:33:35 blowagie Exp $ * $Name:  $ * * Copyright 1999, 2000, 2001, 2002 Bruno Lowagie * * The contents of this file are subject to the Mozilla Public License Version 1.1 * (the "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the License. * * The Original Code is 'iText, a free JAVA-PDF library'. * * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. * All Rights Reserved. * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. * * Contributor(s): all the names of the contributors are added in the source code * where applicable. * * Alternatively, the contents of this file may be used under the terms of the * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the * provisions of LGPL are applicable instead of those above.  If you wish to * allow use of your version of this file only under the terms of the LGPL * License and not to allow others to use your version of this file under * the MPL, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the LGPL. * If you do not delete the provisions above, a recipient may use your version * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. * * This library is free software; you can redistribute it and/or modify it * under the terms of the MPL as stated above or under the terms of the GNU * Library General Public License as published by the Free Software Foundation; * either version 2 of the License, or any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more * details. * * If you didn't download this code from the following link, you should check if * you aren't using an obsolete version: * http://www.lowagie.com/iText/ */package com.lowagie.text.pdf;import java.awt.Color;import com.lowagie.text.Chunk;import com.lowagie.text.Font;import com.lowagie.text.Image;import com.lowagie.text.SplitCharacter;import java.util.HashMap;import java.util.Iterator;import com.lowagie.text.ExceptionConverter;/** * A <CODE>PdfChunk</CODE> is the PDF translation of a <CODE>Chunk</CODE>. * <P> * A <CODE>PdfChunk</CODE> is a <CODE>PdfString</CODE> in a certain * <CODE>PdfFont</CODE> and <CODE>Color</CODE>. * * @see		PdfString * @see		PdfFont * @see		com.lowagie.text.Chunk * @see		com.lowagie.text.Font */class PdfChunk implements SplitCharacter{/** The allowed attributes in variable <CODE>attributes</CODE>. */    private static final HashMap keysAttributes = new HashMap();    /** The allowed attributes in variable <CODE>noStroke</CODE>. */    private static final HashMap keysNoStroke = new HashMap();        static {        keysAttributes.put(Chunk.ACTION, null);        keysAttributes.put(Chunk.STRIKETHRU, null);        keysAttributes.put(Chunk.UNDERLINE, null);        keysAttributes.put(Chunk.REMOTEGOTO, null);        keysAttributes.put(Chunk.LOCALGOTO, null);        keysAttributes.put(Chunk.LOCALDESTINATION, null);        keysAttributes.put(Chunk.GENERICTAG, null);        keysAttributes.put(Chunk.NEWPAGE, null);        keysAttributes.put(Chunk.IMAGE, null);        keysAttributes.put(Chunk.BACKGROUND, null);        keysAttributes.put(Chunk.PDFANNOTATION, null);        keysNoStroke.put(Chunk.SUBSUPSCRIPT, null);        keysNoStroke.put(Chunk.SPLITCHARACTER, null);        keysNoStroke.put(Chunk.HYPHENATION, null);    }        // membervariables    /** The value of this object. */    protected String value = PdfObject.NOTHING;        /** The encoding. */    protected String encoding = PdfObject.ENCODING;        /** The font for this <CODE>PdfChunk</CODE>. */    protected PdfFont font;        protected SplitCharacter splitCharacter;/** * Metric attributes. * <P> * This attributes require the mesurement of characters widths when rendering * such as underline. */    protected HashMap attributes = new HashMap();    /** * Non metric attributes. * <P> * This attributes do not require the mesurement of characters widths when rendering * such as Color. */    protected HashMap noStroke = new HashMap();    /** <CODE>true</CODE> if the chunk split was cause by a newline. */    protected boolean newlineSplit;    /** The image in this <CODE>PdfChunk</CODE>, if it has one */    protected Image image;    /** The offset in the x direction for the image */    protected float offsetX;    /** The offset in the y direction for the image */    protected float offsetY;/** Indicates if the height and offset of the Image has to be taken into account */    protected boolean changeLeading = false;    // constructors    /** * Constructs a <CODE>PdfChunk</CODE>-object. * * @param string the content of the <CODE>PdfChunk</CODE>-object * @param font the <CODE>PdfFont</CODE> * @param attributes the metrics attributes * @param noStroke the non metric attributes */        PdfChunk(String string, PdfChunk other) {        value = string;        this.font = other.font;        this.attributes = other.attributes;        this.noStroke = other.noStroke;        Object obj[] = (Object[])attributes.get(Chunk.IMAGE);        if (obj == null)            image = null;        else {            image = (Image)obj[0];            offsetX = ((Float)obj[1]).floatValue();            offsetY = ((Float)obj[2]).floatValue();            changeLeading = ((Boolean)obj[3]).booleanValue();        }        encoding = font.getFont().getEncoding();        splitCharacter = (SplitCharacter)noStroke.get(Chunk.SPLITCHARACTER);        if (splitCharacter == null)            splitCharacter = this;    }    /** * Constructs a <CODE>PdfChunk</CODE>-object. * * @param chunk the original <CODE>Chunk</CODE>-object * @param action the <CODE>PdfAction</CODE> if the <CODE>Chunk</CODE> comes from an <CODE>Anchor</CODE> */        PdfChunk(Chunk chunk, PdfAction action) {        value = chunk.content();                Font f = chunk.font();        float size = f.size();        if (size == Font.UNDEFINED)            size = 12;        BaseFont bf = f.getBaseFont();        if (bf == null) {            // translation of the font-family to a PDF font-family            String fontName = BaseFont.HELVETICA;            int style = f.style();            if (style == Font.UNDEFINED) {                style = Font.NORMAL;            }            switch(f.family()) {                case Font.COURIER:                    switch(style & Font.BOLDITALIC) {                        case Font.BOLD:                            fontName = BaseFont.COURIER_BOLD;                            break;                        case Font.ITALIC:                            fontName = BaseFont.COURIER_OBLIQUE;                            break;                        case Font.BOLDITALIC:                            fontName = BaseFont.COURIER_BOLDOBLIQUE;                            break;                            default:                        case Font.NORMAL:                            fontName = BaseFont.COURIER;                            break;                    }                    break;                case Font.TIMES_NEW_ROMAN:                    switch(style & Font.BOLDITALIC) {                        case Font.BOLD:                            fontName = BaseFont.TIMES_BOLD;                            break;                        case Font.ITALIC:                            fontName = BaseFont.TIMES_ITALIC;                            break;                        case Font.BOLDITALIC:                            fontName = BaseFont.TIMES_BOLDITALIC;                            break;                            default:                        case Font.NORMAL:                            fontName = BaseFont.TIMES_ROMAN;                            break;                    }                    break;                case Font.SYMBOL:                    fontName = BaseFont.SYMBOL;                    break;                case Font.ZAPFDINGBATS:                    fontName = BaseFont.ZAPFDINGBATS;                    break;                    default:                case Font.HELVETICA:                    switch(style & Font.BOLDITALIC) {                        case Font.BOLD:                            fontName = BaseFont.HELVETICA_BOLD;                            break;                        case Font.ITALIC:                            fontName = BaseFont.HELVETICA_OBLIQUE;                            break;                        case Font.BOLDITALIC:                            fontName = BaseFont.HELVETICA_BOLDOBLIQUE;                            break;                            default:                        case Font.NORMAL:                            fontName = BaseFont.HELVETICA;                            break;                    }                    break;            }            try {                bf = BaseFont.createFont(fontName, BaseFont.WINANSI, false);            }            catch (Exception ee) {                throw new ExceptionConverter(ee);            }        }        font = new PdfFont(bf, size);        // other style possibilities        HashMap attr = chunk.getAttributes();        if (attr != null) {            for (Iterator i = attr.keySet().iterator(); i.hasNext();) {                Object name = i.next();                if (keysAttributes.containsKey(name)) {                    attributes.put(name, attr.get(name));                }                else if (keysNoStroke.containsKey(name)) {                    noStroke.put(name, attr.get(name));                }            }            if ("".equals(attr.get(Chunk.GENERICTAG))) {                attributes.put(Chunk.GENERICTAG, chunk.content());            }        }        if (f.isUnderlined())            attributes.put(Chunk.UNDERLINE, null);        if (f.isStrikethru())            attributes.put(Chunk.STRIKETHRU, null);        if (action != null)            attributes.put(Chunk.ACTION, action);        // the color can't be stored in a PdfFont        noStroke.put(Chunk.COLOR, f.color());        noStroke.put(Chunk.ENCODING, font.getFont().getEncoding());        Object obj[] = (Object[])attributes.get(Chunk.IMAGE);        if (obj == null)            image = null;        else {            image = (Image)obj[0];            offsetX = ((Float)obj[1]).floatValue();            offsetY = ((Float)obj[2]).floatValue();            changeLeading = ((Boolean)obj[3]).booleanValue();        }        font.setImage(image);        encoding = font.getFont().getEncoding();        splitCharacter = (SplitCharacter)noStroke.get(Chunk.SPLITCHARACTER);        if (splitCharacter == null)            splitCharacter = this;    }        // methods        protected int getWord(String text, int start) {        int len = text.length();        while (start < len) {            if (!Character.isLetter(text.charAt(start)))                break;            ++start;        }        return start;    }    /** * Splits this <CODE>PdfChunk</CODE> if it's too long for the given width. * <P> * Returns <VAR>null</VAR> if the <CODE>PdfChunk</CODE> wasn't truncated. * * @param		width		a given width * @return		the <CODE>PdfChunk</CODE> that doesn't fit into the width. */        PdfChunk split(float width) {        newlineSplit = false;        if (image != null) {            if (image.scaledWidth() > width) {                PdfChunk pc = new PdfChunk(Chunk.OBJECT_REPLACEMENT_CHARACTER, this);                value = "";                attributes = new HashMap();                image = null;                font = PdfFont.getDefaultFont();                return pc;            }            else                return null;        }        HyphenationEvent hyphenationEvent = (HyphenationEvent)noStroke.get(Chunk.HYPHENATION);        int currentPosition = 0;        int splitPosition = -1;        float currentWidth = 0;                // loop over all the characters of a string        // or until the totalWidth is reached        int lastSpace = -1;        float lastSpaceWidth = 0;        int length = value.length();        char character = 0;        BaseFont ft = font.getFont();        if (ft.getFontType() == BaseFont.FONT_TYPE_CJK && ft.getUnicodeEquivalent(' ') != ' ') {            while (currentPosition < length) {                // the width of every character is added to the currentWidth                char cidChar = value.charAt(currentPosition);                character = ft.getUnicodeEquivalent(cidChar);                // if a newLine or carriageReturn is encountered                if (character == '\n') {                    newlineSplit = true;                    String returnValue = value.substring(currentPosition + 1);                    value = value.substring(0, currentPosition);                    if (value.length() < 1) {                        value = "\u0001";                    }                    PdfChunk pc = new PdfChunk(returnValue, this);                    return pc;                }                currentWidth += font.width(cidChar);                if (character == ' ') {                    lastSpace = currentPosition + 1;                    lastSpaceWidth = currentWidth;                }                if (currentWidth > width)                    break;                // if a split-character is encountered, the splitPosition is altered                if (splitCharacter.isSplitCharacter(character))                    splitPosition = currentPosition + 1;                currentPosition++;            }        }        else {            while (currentPosition < length) {                // the width of every character is added to the currentWidth                character = value.charAt(currentPosition);                // if a newLine or carriageReturn is encountered                if (character == '\r' || character == '\n') {                    newlineSplit = true;                    int inc = 1;                    if (character == '\r' && currentPosition + 1 < length && value.charAt(currentPosition + 1) == '\n')                        inc = 2;                    String returnValue = value.substring(currentPosition + inc);                    value = value.substring(0, currentPosition);                    if (value.length() < 1) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品福利一区二区三区av| 韩国精品主播一区二区在线观看| 另类中文字幕网| 色综合久久天天| 久久久国产一区二区三区四区小说| 午夜精品一区二区三区三上悠亚 | 亚洲国产精品自拍| 欧美性猛片xxxx免费看久爱| 天天操天天色综合| 日韩亚洲欧美高清| 成人av在线网| 亚洲成av人片在线| 2021久久国产精品不只是精品| 国产露脸91国语对白| 国产精品久久久久婷婷二区次| 在线观看不卡视频| 捆绑调教一区二区三区| 欧美激情一区在线观看| 欧美性色aⅴ视频一区日韩精品| 日韩avvvv在线播放| 久久精品男人的天堂| 日本高清视频一区二区| 青青草精品视频| 日韩一区中文字幕| 制服.丝袜.亚洲.另类.中文| 国内偷窥港台综合视频在线播放| 日韩一区欧美一区| 欧美一二三区精品| 盗摄精品av一区二区三区| 一区二区免费在线播放| 欧美成人性福生活免费看| av午夜一区麻豆| 日本aⅴ免费视频一区二区三区| 国产欧美日韩综合精品一区二区| 91丝袜美女网| 国产中文字幕精品| 香蕉乱码成人久久天堂爱免费| 久久精品亚洲一区二区三区浴池 | 精品乱人伦小说| 一本色道久久加勒比精品| 久久99精品久久久久久久久久久久| 国产精品美女久久久久高潮| 欧美肥妇毛茸茸| 99热精品一区二区| 国产一区999| 强制捆绑调教一区二区| 亚洲免费观看视频| 日本一区二区三级电影在线观看 | 日韩不卡一二三区| 亚洲日本一区二区| 国产日产亚洲精品系列| 欧美精品在线观看播放| 91视频在线观看免费| 国产激情视频一区二区在线观看 | 亚洲卡通欧美制服中文| 久久综合精品国产一区二区三区| 精品视频在线免费观看| 91女人视频在线观看| 国产麻豆成人传媒免费观看| 全国精品久久少妇| 亚洲欧美乱综合| 国产精品久久福利| 国产人成亚洲第一网站在线播放 | 日本高清无吗v一区| 成人高清在线视频| 国产精品综合久久| 老司机精品视频导航| 日韩精品1区2区3区| 亚洲一区二区三区不卡国产欧美| 亚洲欧美成人一区二区三区| 国产欧美日韩激情| 中文字幕国产一区| 国产欧美一区在线| 国产女同性恋一区二区| 国产清纯在线一区二区www| 精品国产免费视频| 精品国产网站在线观看| 欧美成人video| 精品99久久久久久| 久久久久免费观看| 国产欧美一区二区精品性色超碰| 国产视频一区不卡| 欧美激情综合在线| 国产精品理论片在线观看| 欧美国产一区二区在线观看| 欧美国产一区二区| 中文字幕制服丝袜成人av | 99r精品视频| 波多野结衣在线aⅴ中文字幕不卡| 国产激情视频一区二区在线观看 | 欧美日韩日日骚| 欧美日韩国产高清一区| 911精品国产一区二区在线| 91精品国产91久久久久久最新毛片| 欧美剧情片在线观看| 欧美一区二区精品| 久久老女人爱爱| 亚洲色欲色欲www在线观看| 亚洲小说春色综合另类电影| 亚洲成人免费看| 久久成人18免费观看| 成人av在线网| 欧美日韩综合一区| 精品少妇一区二区三区在线视频| 精品国产凹凸成av人导航| 亚洲国产精品成人综合色在线婷婷 | 亚洲风情在线资源站| 蜜臀精品久久久久久蜜臀 | 91婷婷韩国欧美一区二区| 欧美午夜一区二区| 欧美成人精品高清在线播放| 国产精品久久久久影院老司| 亚洲一二三专区| 国产一区欧美一区| 色天使久久综合网天天| 日韩视频一区二区在线观看| 国产性色一区二区| 亚洲国产日日夜夜| 国产在线播精品第三| 97久久超碰国产精品电影| 欧美挠脚心视频网站| 中文一区在线播放| 亚洲电影视频在线| 东方aⅴ免费观看久久av| 欧美亚洲一区二区三区四区| 精品国产凹凸成av人导航| 亚洲美女精品一区| 国产一区二三区| 欧美日韩中文字幕一区| 欧美—级在线免费片| 日韩av二区在线播放| 99久久精品99国产精品 | 国产亚洲一本大道中文在线| 亚洲成人tv网| 99久久精品费精品国产一区二区| 日韩一区二区在线看| 成人免费一区二区三区视频 | 国产日产欧美一区| 蜜桃视频一区二区三区在线观看| 99久久99久久精品国产片果冻| 日韩欧美一二区| 亚洲自拍偷拍av| 成人18精品视频| 精品福利视频一区二区三区| 亚洲香肠在线观看| av网站一区二区三区| 26uuu欧美| 日本不卡1234视频| 欧美日韩不卡视频| 亚洲色图20p| 91欧美一区二区| 国产精品乱码人人做人人爱 | 国产人久久人人人人爽| 久久99精品网久久| 日韩一级高清毛片| 日本在线观看不卡视频| 欧美性感一区二区三区| 亚洲乱码中文字幕| 97精品久久久午夜一区二区三区| 久久久久久久久久久电影| 日本女优在线视频一区二区| 欧美伊人精品成人久久综合97| 中文字幕在线视频一区| 不卡一二三区首页| 国产精品久久久久精k8 | 韩国毛片一区二区三区| 精品理论电影在线观看| 久久精品二区亚洲w码| 欧美一区二区三区四区高清 | 久久99精品国产麻豆婷婷| 日韩精品一区二区三区四区视频 | 国产一区二区三区四| 久久久久久久精| 国产成人午夜精品影院观看视频| 精品国产乱码久久久久久夜甘婷婷| 日本91福利区| 精品国产青草久久久久福利| 激情亚洲综合在线| 欧美激情在线一区二区三区| 成人禁用看黄a在线| 亚洲摸摸操操av| 欧美日韩在线观看一区二区 | 亚洲精品欧美二区三区中文字幕| 色综合久久综合| 午夜精品福利一区二区三区av| 91精品在线一区二区| 精品一区二区三区在线播放 | 99久久免费精品| 一区二区三区高清不卡| 欧美日韩电影一区| 九色综合狠狠综合久久| 国产丝袜在线精品| 91蜜桃视频在线| 天堂影院一区二区| 久久一留热品黄| 91美女视频网站| 视频一区二区三区入口| 精品国产制服丝袜高跟| 成人av在线网站| 亚洲国产精品欧美一二99|