Change of custom DPI value issue


Dear Team,
I tried to convert image(tiff/ jpeg/ png) to PDF by setting custom dpi resolution value as 300dpi. The image had been converted into pdf but the conversion failed to set dpi resolution value as 300 dpi.
kindly provide a workaround solution.

Attached input file:
DPI (1.4 MB)
Code used:

Image image = (Image)Image.load(dataDir);
PdfOptions pdfOptions = new PdfOptions();
ResolutionSetting rs=new ResolutionSetting();
dataDir = fileNameWithOutExt+".pdf";,pdfOptions);



I have observed your comments. Can you please visit this thread link. This will help you out in this issue. Please share feedback with us if there is still an issue.


Hi @Adnan.Ahmad
I tried the above thread(DPI Issue) you posted but was unable to get the expected output.
Above thread only gives the changes in image width,height and dpi value is automatically applied but i need to set different dpi value for different images



I like to inform that i have worked with your issue in detail. Can you please share more sample files along with generated result for testing purpose. Also please explain your issue in more details.



Please visit this thread link. I have shared sample code that will help you to achieve your requirements.


Dear @Adnan.Ahmad
Thanks for the code,it works fineā€¦
My question is could we increase or decrease the dpi value for an image? If yes, then could you please provide me a workaround solution.
Attached sample:
12.jpg (17.7 KB)



I like to inform that we can change dpi value for PDF but for JPG image we have to investigate this on our end. A ticket with ID IMAGINGJAVA-1405 has been created in our issue tracking system. We will share good news with you soon.


Dear @Adnan.Ahmad
Thank you :blush:



You are very welcome.