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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜av一区二区| 亚洲天堂网中文字| 麻豆国产精品官网| 日韩欧美国产一区在线观看| 日韩福利视频导航| 精品国产三级a在线观看| 激情综合色综合久久| 久久久精品综合| 成人丝袜高跟foot| 亚洲国产日韩综合久久精品| 欧美一区二区啪啪| 国产精品亚洲一区二区三区在线 | 久久99精品国产.久久久久| 欧美一级久久久| 国产精品一二三区| 亚洲乱码一区二区三区在线观看| 欧美性受xxxx黑人xyx性爽| 另类小说色综合网站| 国产精品理伦片| 欧美日韩综合一区| 国内精品免费在线观看| 亚洲手机成人高清视频| 555www色欧美视频| 丰满少妇在线播放bd日韩电影| 亚洲乱码国产乱码精品精98午夜| 欧美三级乱人伦电影| 国产美女视频91| 一区二区三区精品视频在线| 日韩欧美一二三四区| 99精品欧美一区二区三区小说 | caoporn国产精品| 午夜一区二区三区在线观看| 国产日韩精品一区二区三区| 欧美日韩一区二区三区四区 | 成人avav在线| 全国精品久久少妇| 国产精品传媒入口麻豆| 日韩免费高清视频| 91国产精品成人| 国产成人午夜99999| 日韩激情在线观看| 1024成人网色www| 久久综合视频网| 欧美剧情电影在线观看完整版免费励志电影 | 久久精品国产亚洲aⅴ| 国产精品福利一区二区| 日韩欧美一区在线| 91成人免费网站| 岛国av在线一区| 久久国产尿小便嘘嘘尿| 亚洲 欧美综合在线网络| 中文字幕欧美日韩一区| 日韩精品中午字幕| 欧美日韩日日骚| 日本高清不卡aⅴ免费网站| 精品影视av免费| 日韩高清一级片| 艳妇臀荡乳欲伦亚洲一区| 国产精品免费久久| 久久亚区不卡日本| 欧美成va人片在线观看| 欧美日韩成人一区| 在线欧美小视频| 色综合色狠狠天天综合色| 国产xxx精品视频大全| 极品少妇xxxx偷拍精品少妇| 秋霞电影网一区二区| 午夜视频在线观看一区| 亚洲第一激情av| 亚洲二区在线视频| 午夜久久久久久久久久一区二区| 一区二区三区中文字幕在线观看| 亚洲欧美色一区| 亚洲品质自拍视频| 亚洲精品高清在线观看| 亚洲视频中文字幕| 亚洲乱码国产乱码精品精的特点 | 久久嫩草精品久久久久| 欧美成人性战久久| 欧美电影免费观看高清完整版在| 欧美一区二区三区免费视频| 欧美一区二区三区小说| 亚洲日本在线看| 亚洲色图制服丝袜| 亚洲精品视频在线观看免费| 亚洲激情自拍偷拍| 亚洲午夜三级在线| 日韩黄色一级片| 免费高清在线视频一区·| 秋霞午夜av一区二区三区| 免费在线观看不卡| 经典三级在线一区| 国产99久久久精品| 一本到一区二区三区| 欧美日韩情趣电影| 精品国产91乱码一区二区三区| 欧美精品一区二区三区蜜臀| 国产午夜亚洲精品不卡| 亚洲特黄一级片| 亚洲国产日韩一区二区| 另类小说视频一区二区| 国产a区久久久| 91久久精品一区二区三| 欧美一级xxx| 久久 天天综合| 不卡的电影网站| 欧美精品v国产精品v日韩精品 | 亚洲最新视频在线观看| 视频在线观看一区| 国产黄色91视频| 欧美午夜电影一区| 欧美videos大乳护士334| 一区在线播放视频| 美女视频黄频大全不卡视频在线播放| 国产精品一区二区久久精品爱涩| 色一情一乱一乱一91av| 日韩一区二区电影在线| 自拍视频在线观看一区二区| 日韩激情视频在线观看| 成人avav影音| 日韩视频在线你懂得| 一区二区中文视频| 欧美日韩三级一区| 久久精品夜色噜噜亚洲a∨| 一区二区三区免费观看| 国产馆精品极品| 欧美二区三区91| 日韩美女精品在线| 国内外成人在线视频| 欧美又粗又大又爽| 国产欧美一区二区精品性色| 亚洲电影一级黄| 波多野结衣一区二区三区| 日韩三级免费观看| 亚洲国产综合在线| 99久久久无码国产精品| 精品国产一区二区精华| 亚洲18色成人| 在线免费观看不卡av| 国产欧美日韩另类一区| 麻豆精品视频在线观看视频| 色综合婷婷久久| 国产性做久久久久久| 久久99久久久久| 欧美日韩精品一区二区三区| 亚洲欧美偷拍三级| 成人av集中营| 中文无字幕一区二区三区| 久久精品理论片| 91精品福利在线一区二区三区| 亚洲精品综合在线| 不卡视频在线观看| 国产日韩欧美一区二区三区综合| 美日韩一区二区三区| 欧美色视频一区| 亚洲影视在线观看| 国产日本欧美一区二区| 久久66热偷产精品| 日韩精品一区二区三区视频| 日本美女一区二区三区| 欧美人与z0zoxxxx视频| 天堂蜜桃91精品| 欧美日韩国产高清一区| 亚洲成人精品影院| 欧美视频一区二区三区| 亚洲国产日韩综合久久精品| 欧美日韩一区二区三区免费看| 一区二区三区在线视频观看| 一道本成人在线| 亚洲激情自拍偷拍| 欧美日韩成人在线| 青青草国产成人av片免费| 日韩三级免费观看| 国产真实乱子伦精品视频| 久久丝袜美腿综合| 成人精品鲁一区一区二区| 国产精品久久久久久久久搜平片| 成人黄色777网| 亚洲欧美精品午睡沙发| 在线观看日产精品| 日本亚洲电影天堂| wwww国产精品欧美| 成人av小说网| 亚洲午夜电影网| 日韩精品一区二区三区中文精品 | 欧美激情中文字幕一区二区| 国产91综合网| 亚洲一区二区四区蜜桃| 欧美高清视频不卡网| 激情亚洲综合在线| 国产精品久久久久aaaa| 欧美视频中文一区二区三区在线观看| 日日摸夜夜添夜夜添精品视频| 日韩女优av电影| 成人深夜福利app| 亚洲高清中文字幕| www国产亚洲精品久久麻豆| 99久久99久久精品免费观看| 亚洲午夜在线电影| 精品国产免费久久|