Some images resized during PDF conversion

Hello,
Please take a look at the ‘B Face’ image. Not sure how it’s different from others, but it wasn’t converted correctly.
We use default options for conversion, but let me know if we need to change that:

using (var workbook = new Workbook(inputStream))
{
    workbook.Save(outputStream, Aspose.Cells.SaveFormat.Pdf);
}

Tested using Aspose.Slides.dll v. 24.9.0.0 in .net Core 8.
Test Files.zip (1.5 MB)
Thank you,
Sergey

@sergtey.kogan,

After initial testing, I am able to reproduce the issue as the user has mentioned when converting your template XLSX file to PDF. I found some images resized unnecessarily and wrongly during Excel to PDF conversion.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-58127

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@sergtey.kogan
We found that the cause of the problem is that when we render shapes in a “group” state, the calculated size is different from the expected one. After extensive research on Excel’s group shape behavior, we found that the problem only occurs in some specific cases, and we have not found a suitable pattern to handle such cases. We found that in this particular case, the “group” and child shape data do not seem to comply with the record rules published by Microsoft. This may be a processing rule that Microsoft has not published. Therefore, we cannot provide a fix in a short time or even estimate the timeline for resolving this issue. I am afraid that we have to suspend this task until we can find relevant rules or documents that can help resolve this issue in the future. We deeply apologize for this. We provide three temporary solutions to help you continue to work normally:

“ungroup” the shapes.

  • 1 Open file
  • 2 Click “Page Layout” in the top options
  • 3 Click ‘Selection Pane’ in the expanded options
    At this time, the names of all shapes in the workbook are listed in the list on the right. Selecting a name in the list automatically selects the corresponding shape/group in the workbook.
  • 4 Select Group
    you can select a “Group” respectively in the left list
  • 5 Then find the corresponding selected range in the workbook
  • 6 Right-click->Group->Ungroup.
    Choose any of the methods below to do this.
      1. Right-click the mouse within the selected range. It is more difficult to operate when there are many nearby shapes.
      1. Hover the mouse over the edge of the selected range and right-click when the black cross symbol appears.
      1. The selected range usually has a hollow cross symbol, right click on it.
  • 7 After 6 operations, the selected “group” is no longer a whole, but all selected.
    It should be noted that it is necessary to “ungroup” until the expected shape is no longer surrounded by the “group”.
    For your question:
    • 1)Perform an Ungroup operation on ’Group 3‘ .
    • 2)Perform an Ungroup operation on ’Group 5‘.
  • 8 Save document

Use VBA macro to cancel all partitions in one click

This method will perform an “Ungroup” operation on all “Group” shapes.

  • 1 Open file
  • 2 Open the VBA Editor
    Press Alt + F11 to open the VBA Editor.
  • 3 Insert a module
    In the VBA editor, click “Insert” on the menu bar and select “Module” to create a new VBA code page(e.g Name “Module1”).
  • 4 Paste the code
    Paste the following code into the code page:
Sub RecursiveUngroupAllShapes()
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
        Do
            Dim ungrouped As Boolean
            ungrouped = False
            
            Dim i As Long
            For i = ws.Shapes.Count To 1 Step -1
                If ws.Shapes(i).Type = msoGroup Then
                    ws.Shapes(i).Ungroup
                    ungrouped = True
                End If
            Next i
            
        Loop While ungrouped
    Next ws
End Sub
  • 5 Run the macro
    Press F5 to run the macro, or return to Excel and press Alt+F8 to run the macro RecursiveUngroupAllShapes.
  • 6 Remove the VBA macro you just added.
    • 1 If the VBA editor is not open, press Alt+F11 to open the VBA editor.
    • 2 Find the corresponding module in the “Project Explorer” on the left(Usually under Modules, such as Module1.)
    • 3 Right-click the module → select “Remove Module 1…”.
    • 4 The prompt “Do you want to export Module1 before removing it?” appears: Select “No”
    • 5 Close the VBA Editor
  • 6 Save document

Replace the problematic part with a picture

The expected graphic combination can be made into a picture and then inserted into the document, which is very helpful for solving some complex graphic requirements.

Thank you @duojie.yang
We’ve tested your solution before, it works. Will advise a customer. Hopefully, it’s a rare occurrence.

@sergtey.kogan,

I’m glad to hear the suggested solution meets your requirements. Kindly advise your clients to implement your preferred option to address the issue.