ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Tiff image squished in pdf

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ioan Posted - Nov 02 2020 : 14:41:56
I'm trying to make a pdf from tiff images, but the images in the pdf are squished. If I use the same tiff in imagemagick, the pdf appears fine, but the one I create with imageen is squished. Is there anything I'm doing wrong? Here is my code I'm using to create the pdf:


    tiff := TIEMultiBitmap.Create;
    try
      tiff.ParamsEnabled := True;
      tiff.Read(TiffFileName, nil, true);
      tiff.Params[0].TIFF_Compression := ioTIFF_JPEG;
      tiff.Params[0].PDF_Compression := ioPDF_JPEG;
      tiff.DuplicateCompressionInfo;
      tiff.Write(PDFFileName, ioPDF);
    finally
      tiff.Free;
    end;


Please see the attached zip for the tiff file and the example pdf

attach/ioan/2020112144027_tiff-example.zip
34.79 KB
4   L A T E S T    R E P L I E S    (Newest First)
ioan Posted - Nov 03 2020 : 12:32:08
Yes, TImageEnMIO with AutoAdjustDPI solves the problem.

I also sent you an email for the updated source to use TIEMultiBitmap.

Again, thank you for your help!
xequte Posted - Nov 02 2020 : 22:34:17
Sorry, you'll also need to scale the image to correct the unequal DPI.

With TImageEnMIO you can do this automatically using:

https://www.imageen.com/help/TImageEnMIO.AutoAdjustDPI.html


You can email me for a source update that allows you to easily do this with TIEMultiBitmap too.

// load a TIFF, fix the DPI and save it
IEGlobalSettings().AutoAdjustDPI := True;
mbmp := TIEMultiBitmap.create;
mbmp.Read('input.tiff');
mbmp.Write('output.tiff');
mbmp.free;


Nigel
Xequte Software
www.imageen.com
ioan Posted - Nov 02 2020 : 17:07:49
Hi Nigel,

Setting the DpiX and DpiY the same value doesn't seem to fix the problem.
Here is how the tiff looks like in infranview and how the pdf comes out, doesn't matter what DPI values I use.




I also attached the original tiff file here:





attach/ioan/202011217859_771B8EA2E18E4E949E613AA7A13BD0CD.zip
14.34 KB
xequte Posted - Nov 02 2020 : 16:10:13
Hi Ioan

The horz. DPI is 204, whereas the vert. DPI is 98.

Setting them both to the same value should resolve the issue.

https://www.imageen.com/help/TIOParams.DpiX.html
https://www.imageen.com/help/TIOParams.DpiY.html

Nigel
Xequte Software
www.imageen.com