PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Apr 25, 2024 6:30 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Sep 28, 2011 7:52 am 
Offline

Joined: Wed Sep 28, 2011 7:10 am
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2011 8:21 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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);

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2011 8:27 am 
Offline

Joined: Wed Sep 28, 2011 7:10 am
Posts: 2
Aha..

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

works perfectly now, thanks!!

cheers


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 295 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group