本文整理了Java中com.lowagie.text.Image.setDpi()
方法的一些代码示例,展示了Image.setDpi()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setDpi()
方法的具体详情如下:
包路径:com.lowagie.text.Image
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!