Hi,
In my application, I load 5 images with the same sizes (133x100 pixels) in a Word template document.
I use 5 merges fields.
[Template]
{ MERGEFIELD Image:image1 }
{ MERGEFIELD Image:image2 }
{ MERGEFIELD Image:image3 }
{ MERGEFIELD Image:image4 }
{ MERGEFIELD Image:image5 }
[/Template]<br>Document myDoc = new Document("[...]\template.doc");<br>Dictionary<String, String> myImages = new Dictionary<string, string>();<br><br>myImages.Add("image1", "[...]\image1.jpg");<br>myImages.Add("image2", "[...]\image2.jpg");<br>myImages.Add("image3", "[...]\image3.jpg");<br>myImages.Add("image4", "[...]\image4.jpg");<br>myImages.Add("image5", "[...]\image5.jpg");<br><br>myDoc.MailMerge.Execute(</font></font><font face="Courier New" size="2">myImages.Keys.ToArray()</font><font face="Courier New" size="2">,<br></font><font face="Courier New" size="2"> myImages.Values.ToArray()</font><font face="Times New Roman"><font face="Courier New" size="2">);<br>
Do you know why in the document, the 5 images don’t be displayed with the same sizes ?
I read this post <here> to force the image sizes but I think there is a solution more simple to display an image without any change. Do you already have this problem ?
Thanks,
Vic
Hi
Victor,
It's weird. I throught the same sizes in pixels give the same sizes in inches. For examples :
image1.jpg : 133x100 pixels > 0,33x0,44 inches
image2.jpg : 133x100 pixels > 0,33x0,44 inches
image3.jpg : 133x100 pixels > 0,33x0,44 inches
image4.jpg : 133x100 pixels > 0,33x0,44 inches
image5.jpg : 133x100 pixels > 0,33x0,44 inches
But in my test, there are differents sizes :
image1.jpg : 133x100 pixels > 0,33x0,44 inches
image2.jpg : 133x100 pixels > 0,33x0,44 inches
image3.jpg : 133x100 pixels > 0,33x0,44 inches
image4.jpg : 133x100 pixels > 0,33x0,44 inches
image5.jpg : 133x100 pixels > 0,18x0,24 inches
My colleague solved my problem with Paint.NET. He just take the file (image5.jpg) and use Paint.NET to save as another file (image5b.jpg). Then, after building :
image5b.jpg : 133x100 pixels > 0,33x0,44 inches (Paint.NET)
image5.jpg : 133x100 pixels > 0,18x0,24 inches (Photoshop CS5)
I don't understand this behavior...
By the way, thank you for your answer.
Vic
Hi
Victor,
In my first post, the original_image.jpg is the good one (CS5, view in exif data).
Hi Victor,
Hi !
Sorry I forgot to specify my version of Aspose.Words. I use an old version 10.5.0.0.
I didn't ask to my company to buy the lastest version yet.
Vic