• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PdfNumber类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.lowagie.text.pdf.PdfNumber的典型用法代码示例。如果您正苦于以下问题:Java PdfNumber类的具体用法?Java PdfNumber怎么用?Java PdfNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PdfNumber类属于com.lowagie.text.pdf包,在下文中一共展示了PdfNumber类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: invoke

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
	PdfNumber aw = (PdfNumber) operands.get(0);
	PdfNumber ac = (PdfNumber) operands.get(1);
	PdfString string = (PdfString) operands.get(2);

	ArrayList twOperands = new ArrayList(1);
	twOperands.add(0, aw);
	processor.invokeOperator(new PdfLiteral("Tw"), twOperands);

	ArrayList tcOperands = new ArrayList(1);
	tcOperands.add(0, ac);
	processor.invokeOperator(new PdfLiteral("Tc"), tcOperands);

	ArrayList tickOperands = new ArrayList(1);
	tickOperands.add(0, string);
	processor.invokeOperator(new PdfLiteral("'"), tickOperands);
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:18,代码来源:PdfContentStreamProcessor.java


示例2: getColorspace

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
PdfObject getColorspace() {
    if (icc_profile != null) {
        if ((colorType & 2) == 0)
            return PdfName.DEVICEGRAY;
        else
            return PdfName.DEVICERGB;
    }
    if (gamma == 1f && !hasCHRM) {
        if ((colorType & 2) == 0)
            return PdfName.DEVICEGRAY;
        else
            return PdfName.DEVICERGB;
    }
    else {
        PdfArray array = new PdfArray();
        PdfDictionary dic = new PdfDictionary();
        if ((colorType & 2) == 0) {
            if (gamma == 1f)
                return PdfName.DEVICEGRAY;
            array.add(PdfName.CALGRAY);
            dic.put(PdfName.GAMMA, new PdfNumber(gamma));
            dic.put(PdfName.WHITEPOINT, new PdfLiteral("[1 1 1]"));
            array.add(dic);
        }
        else {
            PdfObject wp = new PdfLiteral("[1 1 1]");
            array.add(PdfName.CALRGB);
            if (gamma != 1f) {
                PdfArray gm = new PdfArray();
                PdfNumber n = new PdfNumber(gamma);
                gm.add(n);
                gm.add(n);
                gm.add(n);
                dic.put(PdfName.GAMMA, gm);
            }
            if (hasCHRM) {
                float z = yW*((xG-xB)*yR-(xR-xB)*yG+(xR-xG)*yB);
                float YA = yR*((xG-xB)*yW-(xW-xB)*yG+(xW-xG)*yB)/z;
                float XA = YA*xR/yR;
                float ZA = YA*((1-xR)/yR-1);
                float YB = -yG*((xR-xB)*yW-(xW-xB)*yR+(xW-xR)*yB)/z;
                float XB = YB*xG/yG;
                float ZB = YB*((1-xG)/yG-1);
                float YC = yB*((xR-xG)*yW-(xW-xG)*yW+(xW-xR)*yG)/z;
                float XC = YC*xB/yB;
                float ZC = YC*((1-xB)/yB-1);
                float XW = XA+XB+XC;
                float YW = 1;//YA+YB+YC;
                float ZW = ZA+ZB+ZC;
                PdfArray wpa = new PdfArray();
                wpa.add(new PdfNumber(XW));
                wpa.add(new PdfNumber(YW));
                wpa.add(new PdfNumber(ZW));
                wp = wpa;
                PdfArray matrix = new PdfArray();
                matrix.add(new PdfNumber(XA));
                matrix.add(new PdfNumber(YA));
                matrix.add(new PdfNumber(ZA));
                matrix.add(new PdfNumber(XB));
                matrix.add(new PdfNumber(YB));
                matrix.add(new PdfNumber(ZB));
                matrix.add(new PdfNumber(XC));
                matrix.add(new PdfNumber(YC));
                matrix.add(new PdfNumber(ZC));
                dic.put(PdfName.MATRIX, matrix);
            }
            dic.put(PdfName.WHITEPOINT, wp);
            array.add(dic);
        }
        return array;
    }
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:73,代码来源:PngImage.java


示例3: getInstance

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
/**
 * Reuses an existing image.
 * @param ref the reference to the image dictionary
 * @throws BadElementException on error
 * @return the image
 */    
public static Image getInstance(PRIndirectReference ref) throws BadElementException {
    PdfDictionary dic = (PdfDictionary)PdfReader.getPdfObjectRelease(ref);
    int width = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.WIDTH))).intValue();
    int height = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.HEIGHT))).intValue();
    Image imask = null;
    PdfObject obj = dic.get(PdfName.SMASK);
    if (obj != null && obj.isIndirect()) {
        imask = getInstance((PRIndirectReference)obj);
    }
    else {
        obj = dic.get(PdfName.MASK);
        if (obj != null && obj.isIndirect()) {
            PdfObject obj2 = PdfReader.getPdfObjectRelease(obj);
            if (obj2 instanceof PdfDictionary)
                imask = getInstance((PRIndirectReference)obj);
        }
    }
    Image img = new ImgRaw(width, height, 1, 1, null);
    img.imageMask = imask;
    img.directReference = ref;
    return img;
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:29,代码来源:Image.java


示例4: invoke

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
    PdfNumber aw = (PdfNumber)operands.get(0);
    PdfNumber ac = (PdfNumber)operands.get(1);
    PdfString string = (PdfString)operands.get(2);
    
    ArrayList twOperands = new ArrayList(1);
    twOperands.add(0, aw);
    processor.invokeOperator(new PdfLiteral("Tw"), twOperands);

    ArrayList tcOperands = new ArrayList(1);
    tcOperands.add(0, ac);
    processor.invokeOperator(new PdfLiteral("Tc"), tcOperands);
    
    ArrayList tickOperands = new ArrayList(1);
    tickOperands.add(0, string);
    processor.invokeOperator(new PdfLiteral("'"), tickOperands);
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:18,代码来源:PdfContentStreamProcessor.java


示例5: indexedModel

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
private Image indexedModel(byte bdata[], int bpc, int paletteEntries) throws BadElementException {
    Image img = new ImgRaw(width, height, 1, bpc, bdata);
    PdfArray colorspace = new PdfArray();
    colorspace.add(PdfName.INDEXED);
    colorspace.add(PdfName.DEVICERGB);
    byte np[] = getPalette(paletteEntries);
    int len = np.length;
    colorspace.add(new PdfNumber(len / 3 - 1));
    colorspace.add(new PdfString(np));
    PdfDictionary ad = new PdfDictionary();
    ad.put(PdfName.COLORSPACE, colorspace);
    img.setAdditional(ad);
    return img;
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:15,代码来源:BmpImage.java


示例6: getValue

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
/**
 * Returns a PdfObject that can be used as the value of a Collection Item.
 * @param v	value	the value that has to be changed into a PdfObject (PdfString, PdfDate or PdfNumber)	
 */
public PdfObject getValue(String v) {
	switch(fieldType) {
	case TEXT:
		return new PdfString(v, PdfObject.TEXT_UNICODE);
	case DATE:
		return new PdfDate(PdfDate.decode(v));
	case NUMBER:
		return new PdfNumber(v);
	}
	throw new IllegalArgumentException(v + " is not an acceptable value for the field " + get(PdfName.N).toString());
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:16,代码来源:PdfCollectionField.java


示例7: addItem

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
/**
 * Sets the value of the collection item.
 * @param n
 */
public void addItem(String key, PdfNumber n) {
	PdfName fieldname = new PdfName(key);
	PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
	if (field.fieldType == PdfCollectionField.NUMBER) {
		put(fieldname, n);
	}
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:12,代码来源:PdfCollectionItem.java


示例8: getColorspace

import com.lowagie.text.pdf.PdfNumber; //导入依赖的package包/类
PdfObject getColorspace() {
    if (gamma == 1f && !hasCHRM) {
        if ((colorType & 2) == 0)
            return PdfName.DEVICEGRAY;
        else
            return PdfName.DEVICERGB;
    }
    else {
        PdfArray array = new PdfArray();
        PdfDictionary dic = new PdfDictionary();
        if ((colorType & 2) == 0) {
            if (gamma == 1f)
                return PdfName.DEVICEGRAY;
            array.add(PdfName.CALGRAY);
            dic.put(PdfName.GAMMA, new PdfNumber(gamma));
            dic.put(PdfName.WHITEPOINT, new PdfLiteral("[1 1 1]"));
            array.add(dic);
        }
        else {
            PdfObject wp = new PdfLiteral("[1 1 1]");
            array.add(PdfName.CALRGB);
            if (gamma != 1f) {
                PdfArray gm = new PdfArray();
                PdfNumber n = new PdfNumber(gamma);
                gm.add(n);
                gm.add(n);
                gm.add(n);
                dic.put(PdfName.GAMMA, gm);
            }
            if (hasCHRM) {
                float z = yW*((xG-xB)*yR-(xR-xB)*yG+(xR-xG)*yB);
                float YA = yR*((xG-xB)*yW-(xW-xB)*yG+(xW-xG)*yB)/z;
                float XA = YA*xR/yR;
                float ZA = YA*((1-xR)/yR-1);
                float YB = -yG*((xR-xB)*yW-(xW-xB)*yR+(xW-xR)*yB)/z;
                float XB = YB*xG/yG;
                float ZB = YB*((1-xG)/yG-1);
                float YC = yB*((xR-xG)*yW-(xW-xG)*yW+(xW-xR)*yG)/z;
                float XC = YC*xB/yB;
                float ZC = YC*((1-xB)/yB-1);
                float XW = XA+XB+XC;
                float YW = 1;//YA+YB+YC;
                float ZW = ZA+ZB+ZC;
                PdfArray wpa = new PdfArray();
                wpa.add(new PdfNumber(XW));
                wpa.add(new PdfNumber(YW));
                wpa.add(new PdfNumber(ZW));
                wp = wpa;
                PdfArray matrix = new PdfArray();
                matrix.add(new PdfNumber(XA));
                matrix.add(new PdfNumber(YA));
                matrix.add(new PdfNumber(ZA));
                matrix.add(new PdfNumber(XB));
                matrix.add(new PdfNumber(YB));
                matrix.add(new PdfNumber(ZB));
                matrix.add(new PdfNumber(XC));
                matrix.add(new PdfNumber(YC));
                matrix.add(new PdfNumber(ZC));
                dic.put(PdfName.MATRIX, matrix);
            }
            dic.put(PdfName.WHITEPOINT, wp);
            array.add(dic);
        }
        return array;
    }
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:67,代码来源:PngImage.java



注:本文中的com.lowagie.text.pdf.PdfNumber类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RxSwipeRefreshLayout类代码示例发布时间:2022-05-22
下一篇:
Java SwappedByteBuf类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap