C
Cubaman
Hello:
I'm currently exporting a powerpoint presentation to jpg. It works
fine till there is a graph object embed in the presentation. In this
case the resulting image apears as a white empty image. The code i'm
using is as follows:
Private Shared Sub ConvertToImageInternal(ByVal params As Object)
Dim paramList As Object() = CType(params, Object())
Dim inPath As String = paramList(0)
Dim outPath As String = paramList(1)
Dim powerPointApp As Application = New Application()
Dim presentation As Presentation = Nothing
Try
presentation = powerPointApp.Presentations.Open(inPath, _
MsoTriState.msoTrue, _
MsoTriState.msoFalse, _
MsoTriState.msoFalse)
presentation.SaveAs(outPath, _
PpSaveAsFileType.ppSaveAsJPG, _
MsoTriState.msoCTrue)
presentation.Close()
powerPointApp.Quit()
Finally
GC.Collect()
GC.WaitForPendingFinalizers()
If Not presentation Is Nothing Then
Marshal.FinalReleaseComObject(presentation)
presentation = Nothing
End If
If Not powerPointApp Is Nothing Then
Marshal.FinalReleaseComObject(powerPointApp)
powerPointApp = Nothing
End If
End Try
If i export the same slides using PowerPoint app in normal way, it
just works fine. Any sugestion on how to correctly export the images?
Thanks!
I'm currently exporting a powerpoint presentation to jpg. It works
fine till there is a graph object embed in the presentation. In this
case the resulting image apears as a white empty image. The code i'm
using is as follows:
Private Shared Sub ConvertToImageInternal(ByVal params As Object)
Dim paramList As Object() = CType(params, Object())
Dim inPath As String = paramList(0)
Dim outPath As String = paramList(1)
Dim powerPointApp As Application = New Application()
Dim presentation As Presentation = Nothing
Try
presentation = powerPointApp.Presentations.Open(inPath, _
MsoTriState.msoTrue, _
MsoTriState.msoFalse, _
MsoTriState.msoFalse)
presentation.SaveAs(outPath, _
PpSaveAsFileType.ppSaveAsJPG, _
MsoTriState.msoCTrue)
presentation.Close()
powerPointApp.Quit()
Finally
GC.Collect()
GC.WaitForPendingFinalizers()
If Not presentation Is Nothing Then
Marshal.FinalReleaseComObject(presentation)
presentation = Nothing
End If
If Not powerPointApp Is Nothing Then
Marshal.FinalReleaseComObject(powerPointApp)
powerPointApp = Nothing
End If
End Try
If i export the same slides using PowerPoint app in normal way, it
just works fine. Any sugestion on how to correctly export the images?
Thanks!