• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

image clarity for jpeg after converting to pdf using iText

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Krishna Chaitanya Reddy Balam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.png image returns the true Dpi but any .jpg image returns zero for getDpiX and getDpiY methods.
 
Krishna Chaitanya Reddy Balam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic