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:56 am

Code: Select all
ppt = Presentation()
#Load file
ppt.LoadFromFile(inputFile)
for i, slide in enumerate(ppt.Slides):
    #Initialize another instance of Presentation, and remove the blank slide
    newppt = Presentation()
    newppt.Slides.RemoveAt(0)
    #Append the specified slide from old presentation to the new one
    newppt.Slides.AppendBySlide(slide)
    #Save the document
    result =outputFolder + "//" + "SplitPPT-"+str(i)+".pptx"
    newppt.SaveToFile(result, FileFormat.Pptx2010)
    newppt.Dispose()
ppt.Dispose()

Here is the wrong message:
Unhandled Exception: System.AccessViolationException: Arg_AccessViolationException
at System.Runtime.InteropServices.Marshal.ReadInt64(IntPtr, Int32) + 0x54
at Spire.Presentation.AOT.NLPresentation.Presentation_get_Slides(IntPtr, IntPtr) + 0x30

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

Mon Jun 16, 2025 10:11 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