PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jun 29, 2024 10:40 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: smaller image
PostPosted: Sun Sep 26, 2010 10:51 pm 
Offline

Joined: Sun Sep 26, 2010 10:28 pm
Posts: 3
Hi all,

i have a funny behavior drawing two images to a pdf.
i use Ximage.FromFile method to load both the images but after drawing the images my Pdf shows the first image smaller than
the original ?

First image dimensions are width=300,height=500
Second image dimensions are width=500,height=334
i use .PNG image format.

Thanks

P.S.: see attached files


Attachments:
File comment: captured from the pdf created using pdfsharp library
my_pdf.jpg
my_pdf.jpg [ 47.7 KiB | Viewed 6072 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: smaller image
PostPosted: Mon Sep 27, 2010 7:50 am 
Offline

Joined: Sun Sep 26, 2010 10:28 pm
Posts: 3
i have the same effect using Z3.jpg image (from PdfSharp samples).
It shows smaller than the original (seen in Photoshop).

Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: smaller image
PostPosted: Mon Sep 27, 2010 8:03 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
marcocim wrote:
First image dimensions are width=300,height=500
Second image dimensions are width=500,height=334

Dimensions don't matter.

If you don't specify an image size while drawing, images will be drawn with their actual size (as specified in the image file).
And width=500 pixel can be 1 cm or 5 inches or anything else.

Open the images in Microsoft Word and scale them to 100 % - you might get the same sizes ...

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: smaller image
PostPosted: Mon Sep 27, 2010 9:02 am 
Offline

Joined: Sun Sep 26, 2010 10:28 pm
Posts: 3
Thank you Thomas,

there is a method inside PdfSharp to scale the image proportionally ?

I need to fit images inside the box but maintaining proportions.


Top
 Profile  
Reply with quote  
 Post subject: Re: smaller image
PostPosted: Mon Sep 27, 2010 9:12 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
marcocim wrote:
there is a method inside PdfSharp to scale the image proportionally?

I'm afraid there's not.

But it only takes a few lines of code to do it.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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