Hello Spire Support Team,
I'm experiencing a critical FFI (Foreign Function Interface) error when attempting to set shape position properties (Left and Top) using Spire.Presentation for Python on macOS. This is blocking a production application that relies on programmatic PowerPoint editing.
IMPORTANT NOTE: This issue is a deciding factor in our purchasing decision between Spire.Presentation and Aspose.Slides. We need a reliable solution for programmatic PowerPoint editing on macOS, and the ability to set shape positions is essential for our use case. If this cannot be resolved, we will need to proceed with Aspose.Slides instead.
ISSUE DESCRIPTION
When attempting to set the Left or Top properties on shape objects, the library throws a RuntimeError: ffi_prep_cif_var failed exception. This occurs even with simple operations:
from spire.presentation import Presentation, FileFormat
presentation = Presentation()
presentation.LoadFromFile("test.pptx")
first_slide = presentation.Slides[0]
shape = first_slide.Shapes[0]
# This line throws: RuntimeError: ffi_prep_cif_var failed
shape.Left = 500
shape.Top = 300
SYSTEM INFORMATION
Operating System: macOS (Darwin 24.6.0)
Python Version: 3.12.7 (also tested with 3.13.11 - same issue)
Spire.Presentation Version: 10.12.0
Architecture: x86_64 (Intel-based Mac)
Installation Method: pip install Spire.Presentation
ADDITIONAL OBSERVATIONS
1. Reading properties works fine: shape.Left and shape.Top can be read without errors
2. Text editing works: Setting text content via TextFrame.Paragraphs[0].Text works correctly
3. RectangleF creation also fails: Attempting to create RectangleF objects throws the same FFI error
4. Error is consistent: Occurs 100% of the time when trying to set position properties
SIMILAR ISSUES FIXED IN OTHER SPIRE PRODUCTS
I understand that similar FFI errors have been successfully resolved in other Spire products:
- Spire.Doc for Python 12.7.1 (July 2024): Fixed ffi_prep_cif_var failed exception on Ubuntu 22 (Ticket: SPIREDOC-10645)
- Spire.PDF for Python 10.11.2 (November 2024): Fixed ffi_prep_cif_var failed exception when extracting text on Ubuntu 22 (Ticket: SPIREPDF-7039)
Both fixes addressed libffi compatibility issues by recompiling the native bindings against the correct libffi version. I believe a similar fix is needed for Spire.Presentation on macOS.
BUSINESS IMPACT
This issue is blocking a production application that requires:
- Programmatic adjustment of shape positions (alignment fixes)
- Automated correction of spacing and layout issues
- Batch processing of PowerPoint presentations
Without the ability to set position properties, we cannot use Spire.Presentation for its intended purpose of programmatic PowerPoint editing.
QUESTIONS
1. Is there a known workaround for this issue on macOS?
2. Is this issue being tracked in your internal bug tracking system? If so, what is the ticket number?
3. What is the timeline for a fix similar to the ones implemented in Spire.Doc and Spire.PDF?
4. Do you need additional information or test cases to reproduce and fix this issue?
I am happy to provide:
- Additional system information
- Sample PPTX files that reproduce the issue
- More detailed error logs
- Testing on different macOS versions if needed
MINIMAL REPRODUCIBLE EXAMPLE
Here is a minimal reproducible example:
from spire.presentation import Presentation, FileFormat
try:
presentation = Presentation()
presentation.LoadFromFile("test.pptx")
first_slide = presentation.Slides[0]
if first_slide.Shapes.Count > 0:
shape = first_slide.Shapes[0]
# Reading works
current_left = shape.Left
current_top = shape.Top
print(f"Current position: {current_left}, {current_top}")
# Writing fails with FFI error
shape.Left = 500 # RuntimeError: ffi_prep_cif_var failed
shape.Top = 300
presentation.SaveToFile("output.pptx", FileFormat.Pptx2016)
presentation.Dispose()
except Exception as e:
print(f"Error: {type(e).__name__}: {e}")
FULL ERROR TRACEBACK
RuntimeError: ffi_prep_cif_var failed
Thank you for your attention to this matter. I look forward to your response and am available to assist with testing or providing additional information as needed.