Skip to content Skip to sidebar Skip to footer

Insert Several Images At Once Using Macro Scripting In LibreOffice

I am writing a macro for LibreOffice Writer in Python. I need to insert several images in one document, one after another with minimal space inbetween them. The folowing code inser

Solution 1:

Insert a paragraph break after each image:

from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK

    text.insertTextContent(cursor, img, False)
    text.insertControlCharacter(cursor, PARAGRAPH_BREAK, False)
    cursor.gotoEnd(False)

This will separate the images... by a paragraph

Andrew's book is a basic source for solving many OpenOffice scripting problems: +1


Post a Comment for "Insert Several Images At Once Using Macro Scripting In LibreOffice"