I have so much pictures to put in Draw’s files and center on each pages.
With LibreOffice, I open a new Draw page and drag and drop my picture first. This did, I right click on the picture and choose "Align", then "Center Horizontal". Then I repeat right click on the picture and choose "Align", then "Vertical Center". How long is that!!!
For accelerate this, I writed a macro and put a choice in my image context menu I called "Center image". A dream...
Code: Select all
Sub centerDrawObjet
Dim myPage As Object, myImage As Object
Dim newPosition As New com.sun.star.awt.Point
If isNull(thisComponent.currentSelection) Then
msgBox "Maybe a selection can help...", 16, "Select something!!!"
Exit Sub
End If
myPage = thisComponent.masterPages.getByIndex(0)
myImage = thisComponent.currentSelection.getByIndex(0)
newPosition.x = int((myPage.width - myImage.size.width) / 2)
newPosition.y = int((myPage.height - myImage.size.height) / 2)
myImage.position = newPosition
End Sub