I am using Aspose Cells 184.108.40.206 to create an Excel document which will contain some map images. The document is to be saved to pdf format. However, the map images are stretched horizontally by about 5-10%, which degrades the value of the map.
The code to reproduce this problem is simple:
// Get Map Bitmap resource...
Bitmap image = Properties.Resources.MapImage;
System.IO.MemoryStream imageStream = new System.IO.MemoryStream();
// Create Aspose worksheet and add Map Bitmap as picture...
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets.Add("Map Image");
int index = sheet.Pictures.Add(0, 0, imageStream);
//var picture = sheet.Pictures[index];
//picture.WidthScale = 92;
String outputPath = "MapImageTest.pdf";
The resulting pdf does not properly render the map circle as seen in the attachment.
If I enable the picture.WidthScale = 92; line in the above example, the map is better.
Is this a bug or is there a standard way to maintain proper aspect ratio that will work for all images?
I look forward to hearing from you.