PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 8:40 pm

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
 Post subject: Pixel to Point?
PostPosted: Wed Sep 02, 2009 10:08 am 
Offline

Joined: Wed Sep 02, 2009 10:02 am
Posts: 2
Hi,

I have the following situation:
I open an existing pdf with PDF sharp. Then I draw an image (50x50px) with MigraDoc's renderObject on the existing pdf page at location 0,0. Then I draw a table again with MigraDocs renderObject at location 0,0 - but now I want the first column to have a width of exacly 50px - so it has the exactly same width as the image that got drawn.
How do I do that? I can specify the width of the column - but only in points, centimeters, etc. So how do I convert from points to pixels?
Oh, and I use version 1.3 and GDI+.

Thanks in advance


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel to Point?
PostPosted: Wed Sep 02, 2009 10:27 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

A PDF file has no pixels.

Your image will be drawn in the size you specify. Just specify the same width for image and column.

Some images have a resolution stored with them; if you don't specify the width, the width will be calculated based on the resolution.
You can also use that: if the image has e. g. 72 or 96 DPI you can calculate the cm or points from that.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel to Point?
PostPosted: Wed Sep 02, 2009 10:51 am 
Offline

Joined: Wed Sep 02, 2009 10:02 am
Posts: 2
Oh ok, now I understand, Thanks for the fast answer!


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 373 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