Export to bmp

Hi, excuse me for my simple english…

I’ve made a presentation with 12 diapos and I need to export each diapo in a bmp file. With microsoft Powerpoint, export will save each diapo in a single bmp file in a folder. With LibreOffice I have to export 12 times one dia in one bmp file… May it be more simple and how ?

I’m not familiar with Impress, so not sure if there is a built in method to save all slides as bmp, If there is then hopefully someone can provide you with a simpler solution.

Following Macro will create bmp of each slide into the same folder as the Impress document. This could be configured to run from a hot key or from a bash or bat script.

REM  *****  BASIC  *****

Option Explicit

Sub WriteBMPSlides()

	Dim oDoc As Object
	Dim oSlide As Object
	Dim oDrawPages As Object
	Dim oFilter As Object
	Dim Args(2) As New com.sun.star.beans.PropertyValue
	Dim sDirectory As String
	Dim sFileName As String
	Dim i As Integer
	
	oDoc = thisComponent
	
	If oDoc.Identifier <> "com.sun.star.presentation.PresentationDocument" Then
		msgbox "Only PresentationDocument type is supported"
		Exit Sub
	End If
	
	If oDoc.Location = "" Then
		msgbox	"Save the presentation to a folder where we will save the slide images."
		Exit Sub
	End If
	
	sFileName = oDoc.Title
	sDirectory = replace(oDoc.Location, "%20", " " )	'	Allow for spaces in name as %20
	sDirectory = replace(sDirectory, sFileName, "" )
	
	sFileName = left(sFileName, instr(sFileName,".") - 1)
	
	oDrawPages = oDoc.getDrawPages
	
	oFilter=CreateUnoService("com.sun.star.drawing.GraphicExportFilter")
	
	For i = 0 To oDrawPages.Count - 1
		oSlide = oDrawPages.getByIndex(i)
		
'		msgbox "test calling macro from command line" & chr(10) & oSlide.name		'	Debug only
		
		oFilter.setSourceDocument(oSlide)
		
		Args(0).Name = "URL"
		Args(0).Value = sDirectory & sFileName & "_" & oSlide.name & ".BMP"
		Args(1).Name = "MediaType"
		Args(1).Value = "image/bmp"
		Args(2).Name = "Overwrite"
		Args(2).value = false
		
		oFilter.filter(args())
	Next i
	
	'	Enable the following line if you call macro from windows batch file
'	thisComponent.Close(true)
End Sub