PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Tiff FAX to PDF wrong size
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1796
Page 1 of 1

Author:  dbuch [ Wed Sep 28, 2011 7:52 am ]
Post subject:  Tiff FAX to PDF wrong size

Hi
I am converting a TIF ( a fax) into a PDF. it converts, but the imaged is squashed down.

Can anyone tell me how to get the correct resolution so the pdf looks the same as the TIF?

Thanks

Author:  Thomas Hoevel [ Wed Sep 28, 2011 8:21 am ]
Post subject:  Re: Tiff FAX to PDF wrong size

Hi!

How do you draw the image?

Code:
double width = image.PixelWidth * 72 / image.HorizontalResolution;
double height = image.PixelHeight * 72 / image.VerticalResolution;
gfx.DrawImage(image, 0, 0, width, height);

Author:  dbuch [ Wed Sep 28, 2011 8:27 am ]
Post subject:  Re: Tiff FAX to PDF wrong size

Aha..

I was doing everything except passing the width and height into
gfx.DrawImage(image, 0, 0, width, height);

works perfectly now, thanks!!

cheers

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/