Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It's more easy, if you first create page style then apply in each sheet.

Sub Main()
Dim args1(0) As New com.sun.star.beans.PropertyValue
Dim args2(0) As New com.sun.star.beans.PropertyValue

    args1(0).Name = "MacroExecutionMode"
    args1(0).Value = 4  
    source = ConvertToURL("/home/mau/toPDF.ods")
    doc = StarDesktop.loadComponentFromURL(source, "_default", 0, args1)

    For Each sheet In doc.Sheets
        sheet.PageStyle = "myStyle"
    Next

    args2(0).Name = "FilterName"
    args2(0).Value = "calc_pdf_Export"
    target = ConvertToURL("/home/mau/test.pdf")
    doc.storeToURL(target, args2)
End Sub