Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Jun 15, 2025 7:59 am

Code: Select all
new_ppt = Presentation()
    new_ppt.Slides.RemoveAt(0)  # Remove default blank slide
       
    try:
        # Add slide copy to new presentation
        new_slide = new_ppt.Slides.AppendBySlide(ppt.Slides[i])
       
        # Save to file
        output_file = os.path.join(outputFolder, f"Slide_{i+1}.pptx")
        new_ppt.SaveToFile(output_file,FileFormat.Auto)
    finally:
        # Ensure resources are cleaned up
new_ppt.Dispose()

Here is the wrong message:
raise SpireException(info)
spire.presentation.common.SpireException: TypeInitialization_Type_NoTypeAvailable: at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xbd
at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*, IntPtr) + 0xd
at sprbfg..ctor(Int32, Int32, Single, Single, SKColorType) + 0x65
at sprfh5..ctor(sprbfk) + 0xc7
at sprdfa..ctor(Int32, Int32, Single, Single, Boolean) + 0x7c
at sprciu..ctor(TextParagraphProperties[], ParagraphCollection, Single, Single, Int32, Single, Boolean, TextAnchorType, Boolean, ActiveSlide, ColorFormat.a, LocaleFonts, FontCollectionIndex, Single, Single, Int32, Object, sprcjg) + 0xcf
at sprcjq.spra(Single, Single, ShapeStyle, sprcjq[], sprcjg) + 0xfa5
at sprci1.PptxPrepareForSaving(sprc53) + 0x1ae
at Spire.Presentation.Collections.ShapeList.spra(sprc53) + 0x7d
at Spire.Presentation.GroupShape.PptxPrepareForSaving(sprc53) + 0x180
at Spire.Presentation.ActiveSlide.PresentationBeforeSave(sprc53) + 0x81
at sprci8.PresentationBeforeSave(sprc53) + 0x5d
at sprcjd.spra(sprc53, sprchz) + 0x7e2
at sprcjd.spra(Stream, sprchz, sprdfb) + 0xa5
at sprcjd.spra(Stream, sprde6, sprde7) + 0xa5
at Spire.Presentation.Presentation.SaveToFile(Stream, FileFormat) + 0x24e
at Spire.Presentation.AOT.NLPresentation.Presentation_SaveToFileFF(IntPtr, IntPtr, Int32, IntPtr) + 0x5a0

GongJianxiang
 
Posts: 2
Joined: Sun Jun 15, 2025 4:01 am

Mon Jun 16, 2025 10:19 am

Hello,

Thanks for your inquiry.
I conducted preliminary testing in the Mac environment and did not find any issue. Please provide your Mac system information and your input PPT document. You can attach your document here or send it to my email ([email protected]). Thanks in advance.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Return to Spire.PDF

cron