In c#, we can use Image.HorizontalResolution and Image.VerticalResolution.
But in java, how to get it?
I found ImageInfo.java
, but it only supp
Find dpi of .bmp image use :
import com.lowagie.text.Image.
public class BitmapResolution {
public static void main(String args[]) {
try {
Image img = Image.getInstance("C:/Users/AngryMan/Desktop/img003.bmp");
System.out.println(img.getDpiX());
System.out.println(img.getDpiY());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Maven Dependency :
com.lowagie
itext
2.1.7