com.lowagie.text.Image.setDpi()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(249)

本文整理了Java中com.lowagie.text.Image.setDpi()方法的一些代码示例,展示了Image.setDpi()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setDpi()方法的具体详情如下:
包路径:com.lowagie.text.Image
类名称:Image
方法名:setDpi

Image.setDpi介绍

[英]Sets the dots per inch value
[中]设置每英寸点数值

代码示例

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/** Reads a BMP from a stream. The stream is not closed.
 * The BMP may not have a header and be considered as a plain DIB.
 * @param is the stream
 * @param noHeader true to process a plain DIB
 * @param size the size of the DIB. Not used for a BMP
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(InputStream is, boolean noHeader, int size) throws IOException {
  BmpImage bmp = new BmpImage(is, noHeader, size);
  try {
    Image img = bmp.getImage();
    img.setDpi((int)(bmp.xPelsPerMeter * 0.0254d + 0.5d), (int)(bmp.yPelsPerMeter * 0.0254d + 0.5d));
    img.setOriginalType(Image.ORIGINAL_BMP);
    return img;
  }
  catch (BadElementException be) {
    throw new ExceptionConverter(be);
  }
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/** Reads a BMP from a stream. The stream is not closed.
 * The BMP may not have a header and be considered as a plain DIB.
 * @param is the stream
 * @param noHeader true to process a plain DIB
 * @param size the size of the DIB. Not used for a BMP
 * @throws IOException on error
 * @return the image
 */    
public static Image getImage(InputStream is, boolean noHeader, int size) throws IOException {
  BmpImage bmp = new BmpImage(is, noHeader, size);
  try {
    Image img = bmp.getImage();
    img.setDpi((int)(bmp.xPelsPerMeter * 0.0254d + 0.5d), (int)(bmp.yPelsPerMeter * 0.0254d + 0.5d));
    img.setOriginalType(Image.ORIGINAL_BMP);
    return img;
  }
  catch (BadElementException be) {
    throw new ExceptionConverter(be);
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

img.setDpi(dpiX, dpiY);
if (compression != TIFFConstants.COMPRESSION_OJPEG && compression != TIFFConstants.COMPRESSION_JPEG) {
  if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

img.setDpi(dpiX, dpiY);
if (compression != TIFFConstants.COMPRESSION_OJPEG && compression != TIFFConstants.COMPRESSION_JPEG) {
  if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {

代码示例来源:origin: org.jboss.seam/jboss-seam-pdf

if (dpi != null) {
  int[] dpiValues = ITextUtils.stringToIntArray(dpi);
  image.setDpi(dpiValues[0], dpiValues[1]);

代码示例来源:origin: stackoverflow.com

image.setDpi(-10, -5);
image.setSpacingBefore(-15);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

img = Image.getInstance(w, h, false, Image.CCITTG4, params & Image.CCITT_BLACKIS1, g4pic);
img.setDpi(dpiX, dpiY);
img.setXYRatio(XYRatio);
if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

img = Image.getInstance(w, h, false, Image.CCITTG4, params & Image.CCITT_BLACKIS1, g4pic);
img.setDpi(dpiX, dpiY);
img.setXYRatio(XYRatio);
if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

img.setImageMask(im2);
img.setDpi(dpiX, dpiY);
img.setXYRatio(XYRatio);
img.setOriginalType(Image.ORIGINAL_PNG);

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

img.setImageMask(im2);
img.setDpi(dpiX, dpiY);
img.setXYRatio(XYRatio);
img.setOriginalType(Image.ORIGINAL_PNG);

相关文章

微信公众号

最新文章

更多

Image类方法