After some poking around I dug up the following, based on the referenced post above. The available properties are documented
here, with some additional information
here.
Code: Select all
# Return the number of page styles for the current document.
>>> document.StyleFamilies.getByName("PageStyles").getCount()
10
# Get the name of the first page style.
>>> document.StyleFamilies.getByName("PageStyles").getByIndex(0).getName()
'Standard'
>>> document.StyleFamilies.getByName("PageStyles").getByName("Standard").getName()
'Standard'
# Get a few more properties of this page style.
>>> document.StyleFamilies.getByName("PageStyles").getByIndex(0).Width
21590
>>> document.StyleFamilies.getByName("PageStyles").getByIndex(0).Size
(com.sun.star.awt.Size){ Width = (long)0x270f, Height = (long)0x270f }
>>> document.StyleFamilies.getByName("PageStyles").getByIndex(0).LeftMargin
2000
Looks like assigning values directly to these properties changes the document immediately. It also seems that 'Standard' is the default page size that's used when the cursor runs onto a new page.
Question: Is there a way to automatically alternate 'Left Page' and 'Right Page'?
Question: Is there a way to declare a 'default' page style that's being used when the cursor runs onto a new page?
Mac 10.14 using LO 7.2.0.2, Gentoo Linux using LO 7.2.3.2 headless.