Get DpiX and DpiY for tiff image : Tiff Image « PDF « Java Tutorial






import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class MainClass {
  public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    document.open();
    Image tiff = Image.getInstance("dog.tiff");
    document.add(tiff);
    document.add(new Paragraph("DPI X: " + tiff.getDpiX() + "; DPI Y: " + tiff.getDpiY()));
    
    document.close();
  }
}








29.41.Tiff Image
29.41.1.Load tiff image
29.41.2.Multiple-page Tiff
29.41.3.Get width and height of tiff image
29.41.4.Get DpiX and DpiY for tiff image
29.41.5.Image with 360 Dpi scaled