aspose file tools*
The moose likes Other Open Source Projects and the fly likes image clarity for jpeg after converting to pdf using iText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "image clarity for jpeg after converting to pdf using iText" Watch "image clarity for jpeg after converting to pdf using iText" New topic
Author

image clarity for jpeg after converting to pdf using iText

Krishna Chaitanya Reddy Balam
Greenhorn

Joined: Feb 19, 2008
Posts: 22
Hi all:
I am using iText API to convert images to pdf and was trying to preserve the image resolution when displayed in pdf file and the getDpiX() and getDpiY() methods which returns the DPI for the original image are returning zero values where as the values returned to other type of images are alright.
can some help me in this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42601
    
  65
Welcome to JavaRanch.

According to the javadocs, those methods "Returns 0 if not available". What kind of image is this - a GIF?

Is the image quality actually less than it was originally?


Ping & DNS - my free Android networking tools app
Krishna Chaitanya Reddy Balam
Greenhorn

Joined: Feb 19, 2008
Posts: 22
.png image returns the true Dpi but any .jpg image returns zero for getDpiX and getDpiY methods.
Krishna Chaitanya Reddy Balam
Greenhorn

Joined: Feb 19, 2008
Posts: 22
The .jpg images I tried had 96 DPI on both X and Y, but the methods returned zero values and I was not able to even setDpi()for the image displayed in pdf.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42601
    
  65
Do you have reason to believe that using an image with iText changes its DPI? In other words, is it necessary to do this? That goes back to my previous question of whether the image quality is actually worse.
Krishna Chaitanya Reddy Balam
Greenhorn

Joined: Feb 19, 2008
Posts: 22
Yes iText by default changes the resolution to 72 DPI for any image which is displayed in pdf so it decreases the clarity and this is the main problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image clarity for jpeg after converting to pdf using iText