Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi

For example with LibreOffice Basic:

Sub Main

dim sUrl as string
dim oDoc as object
dim props(0) As New com.sun.star.beans.PropertyValue

sUrl = convertToURL("C:\Test\foo.pdf")

If FileExists(sUrl) then
    props(0).Name = "FilterName"
    props(0).Value = "draw_pdf_import"

    oDoc = stardesktop.LoadComponentFromURL(sUrl, "_blank", 0, props())

    props(0).Value = "OpenDocument Drawing Flat XML"

    sUrl = convertToURL("C:\Test\foo.fodg")
    oDoc.storeToURL(sUrl, props())

    on Error Resume Next
    oDoc.close(True)
    On Error GoTo 0

Else
    msgbox (sUrl & " not found", 16)
End if

End Sub

Regards