We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

RelativeToOriginalPictureSize = false is not working

Hi I’m using Aspose Cells for .NET.

Firstly I’m finding when I insert a picture into the footer of a document, we’re seeing that the scaling of the picture is different on a Mac vs a PC.

We can fix this in Microsoft Excel by opening the document going to Page Layout view, selecting the picture, clicking Format Picture on the toolbar and unchecking the “Relative to original picture size” checkbox. After saving the Document and opening it on a Mac the image looks far more like it does in Excel on a PC.

When we attempt to do this programmatically using Aspose Cells…

Picture picture = pageSetup.SetFooterPicture(ExcelHelper.LeftSection, footer.ReadAllBytes());
picture.RelativeToOriginalPictureSize = false;

When we open the document created in Excel the “Relative to original picture size” checkbox remains checked and the scaling of the picture in Excel remains different between a Mac and a PC.

Could you share the template file and your runnable code snippet. We will analyze it and provide our feedback accordingly.

The following code replicates the problem with Aspose Cells v20.4.0.0

        Workbook workbook = new Workbook(@"..\..\Documents\TestFiles\TestRelativeToOriginalPictureSizeBook.xlsx");

        foreach (Worksheet worksheet in workbook.Worksheets)
            PageSetup pageSetup = worksheet.PageSetup;

            byte[] pic = File.ReadAllBytes(@"..\..\Documents\TestFiles\RelativeToOriginalPictureSize.png");
            Picture picture = pageSetup.SetFooterPicture(0, pic);
            picture.RelativeToOriginalPictureSize = false;
            pageSetup.SetFooter(0, "&G");

        workbook.Save($@"E:\Temp\{ DateTime.Now:yyyyMMdd - HHmm - ss}_Test.xlsx");

I’ve attached a zip file containing an Excel spreadsheet created using Microsoft Excel a png file for the footer and the resulting file created by Aspose. When you select the picture in the footer and click Format Picture “Relative to original picture size” is checked.

TestRelativeToOriginalPictureSizeBook.zip (43.8 KB)

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-47485 - RelativeToOriginalPictureSize = false is not working


This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.


Please try our latest version/fix: Aspose.Cells for .NET v20.7.1 (attached)

Your issue “CELLSNET-47485” should be fixed in it.

Let us know your feedback.
Aspose.Cells20.7.1 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.7.1 For .Net4.0.Zip (5.4 MB)

The issues you have found earlier (filed as CELLSNET-47485) have been fixed in Aspose.Cells for .NET v20.8. This message was posted using Bugs notification tool by Amjad_Sahi