Different Results for Table.y and Cell.offset_y for Unix and Windows

Hello Aspose Team,

I am using Aspose.Slides for Python via .NET and noticed an inconsistency between Windows(local) and Unix(UAT) environments when working with tables.

Problem: The value of the following properties differ between environments:

  • table.x + cell.offset_y
  • cell.height

The values returned by these functions in Windows and Unix differ by 10-20 points which makes it inconsistent. Other functionality(table column deletion, adding image, etc.) is working fine and consistent.

My suspicion is this might be related to font metrics or rendering engine differences.

Version used: aspose.slides@ 25.5.0

Logs:
In Local:

Adding picture: 31x38 to cell 0,1 at 36.2,142.4 with cell size 60.2x108.0
Adding picture: 60.2x16.0 to cell 0,2 at 36.2,250.4 with cell size 60.2x107.5
Adding picture: 60.2x12.8 to cell 0,3 at 36.2,357.9 with cell size 60.2x108.0

In UAT for the same 3 images:

Adding picture: 32x39 to cell 0,1 at 36.2,152.9 with cell size 60.2x124.8
Adding picture: 60.2x16.2 to cell 0,2 at 36.2,277.7 with cell size 60.2x108.0
Adding picture: 60.2x12.9 to cell 0,3 at 36.2,385.7 with cell size 60.2x124.8

Code used:

cell = table.rows[rowIndex][columnIndex]
cell_x = table.x + cell.offset_x
cell_y = table.y + cell.offset_y
cell_width = cell.width
cell_height = cell.height
img_ratio = img.width / img.height

img_width = cell_width
img_height = cell_width / img_ratio

logger.info(f"Adding picture: {round(img_width, 1)}x{round(img_height, 1)} to cell {columnIndex},{rowIndex} at {round(cell_x, 1)},{round(cell_y, 1)} with cell size {round(cell_width, 1)}x{round(cell_height, 1)}")

@abhinandan824

It appears you are encountering inconsistencies in the values of table.x + cell.offset_y and cell.height between Windows and Unix environments while using Aspose.Slides for Python via .NET. This issue may stem from differences in font metrics or rendering engines across these platforms.

To troubleshoot this issue, consider the following steps:

  1. Check Font Availability: Verify that the same fonts are installed and accessible on both environments. Variations in font rendering can lead to discrepancies in measurements.

  2. Standardize Rendering Settings: If feasible, standardize the rendering settings or utilize a specific rendering engine that behaves consistently across platforms.

  3. Debugging: Print the values of table.x, cell.offset_y, and cell.height in both environments to identify any additional discrepancies that may help diagnose the issue.

  4. Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides, as updates may address cross-platform inconsistencies.

If the issue persists, consider reaching out to the Aspose support forum for more specialized assistance.

@abhinandan824,
Thank you for contacting free support. We are sorry you encountered this problem. We need more details to investigate the case. Please share the following files and information:

  • The presentation containing a sample table (you can zip the file and upload the archive here).
  • The operating system names and versions where the inconsistency occurs (Windows and Unix).
  • The Python version you are using.