Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index

Tom ,

Copy the code in a Basic module and run !


Hi :)
I thought the original was asking for a list of all the filters available?

I think Fernand's coding gives a list of the filters in whichever version of libreOffice you happen to be running. As each new release comes out extra filters may have been added and apparently it is difficult to find documentation about which version has which filters. Sadly i have no idea how to run the coding even with the helpful comments! Hopefully you understand this better than me.
Regards from
Tom :)

--- On Mon, 9/1/12, filtered<>  wrote:

From: filtered<>
Subject: Re: [libreoffice-users] Re: Names of output filters? Name of HTML output filter?
Date: Monday, 9 January, 2012, 15:00

How is this related to my question?


Am 9. Januar 2012 14:47 schrieb Fernand Vanrie<>:

With the API and some Basic code from the good old Danny B. can do the job
gives us a 65 pages writer Doc.
Hope its helps



Sub Main
     oFF = createUnoService( "**FilterFactory" )
     oFilterNames = oFF.getElementNames()

     ' Now print the filter names.
'    For i = LBound( oFilterNames ) To UBound( oFilterNames )
'        Print oFilterNames(i)
'    Next

     ' Create a Writer doc and save the filter names to it.
     oDoc = StarDesktop.**loadComponentFromURL( "private:factory/swriter",
"_blank", 0, Array() )
     oText = oDoc.getText()
     oCursor = oText.createTextCursor()
     oCursor.gotoEnd( False )

     oText.insertString( oCursor, "Filter Names", False )
     oCursor.ParaStyleName = "Heading 1"
     InsertParaBreak( oText, oCursor )
     oCursor.ParaStyleName = "Default"
     InsertParaBreak( oText, oCursor )

     ' Print the filter names into a Writer document.
     For i = LBound( oFilterNames ) To UBound( oFilterNames )
         oText.insertString( oCursor, oFilterNames(i), False )
         InsertLineBreak( oText, oCursor )
     InsertParaBreak( oText, oCursor )

     InsertParaBreak( oText, oCursor )
     oText.insertString( oCursor, "Filter Names and their Properties", False
     oCursor.ParaStyleName = "Heading 1"
     InsertParaBreak( oText, oCursor )
     oCursor.ParaStyleName = "Default"

     ' Tab stops at:
     '        0.25 inch    (2.54 cm x 0.25)
     '        0.50 inch    (2.54 cm x 0.50)
     '        2.00 inch    (2.54 cm x 2.00)
     oCursor.ParaTabStops = Array(_
         MakeTabStop( 2540 * 0.25 ),_
         MakeTabStop( 2540 * 0.50 ),_
         MakeTabStop( 2540 * 2.00 ) )

     ' Print the filter names and their parameters.
     For i = LBound( oFilterNames ) To UBound( oFilterNames )
         InsertParaBreak( oText, oCursor )

         cFilterName = oFilterNames(i)
         aFilterProps = oFF.getByName( cFilterName )

         oText.insertString( oCursor, cFilterName, False )

         For j = LBound( aFilterProps ) To UBound( aFilterProps )
             oFilterProp = aFilterProps(j)

             InsertLineBreak( oText, oCursor )
             oText.insertString( oCursor, CHR(9)+oFilterProp.Name, False )

             nFilterPropValueVarType = VarType( oFilterProp.Value )
             If nFilterPropValueVarType = 8201 Then
                 ' VarType 8201 means a sequence of PropertyValue's.
                 oFilterPropNames = oFilterProp.Value
                 For k = LBound( oFilterPropNames ) To UBound(
oFilterPropNames )
                     InsertLineBreak( oText, oCursor )
                     oText.insertString( oCursor, CHR(9)+CHR(9)+**
False )
                 Next k
             ElseIf nFilterPropValueVarType = 8200 Then
                 ' VarType 8200 means a sequence of Strings.
                 oFilterPropNames = oFilterProp.Value
                 For k = LBound( oFilterPropNames ) To UBound(
oFilterPropNames )
                     InsertLineBreak( oText, oCursor )
                     oText.insertString( oCursor, CHR(9)+CHR(9)+**oFilterPropNames(k),
False )
                 Next k
             ElseIf nFilterPropValueVarType>  1  And
   nFilterPropValueVarType<= 12 Then
                 oText.insertString( oCursor, CHR(9)+CSTR(oFilterProp.Value)
**, False )
                 oText.insertString( oCursor, CHR(9)+"?? unknown type ?? -
"+CSTR(**nFilterPropValueVarType), False )
         Next j

         InsertParaBreak( oText, oCursor )
     Next i

     InsertParaBreak( oText, oCursor )
End Sub

Sub InsertLineBreak( oText, oCursor )
     oText.insertControlCharacter( oCursor,**ControlCharacter.LINE_BREAK,
False )
End Sub

Sub InsertParaBreak( oText, oCursor )
     oText.insertControlCharacter( oCursor,**
ControlCharacter.PARAGRAPH_**BREAK, False )
End Sub

' Create and return a tab stop.
' An array of what this function returns, is used
'  to set the tab stops of a paragraph.
' Parameters....
'    nPosition - position in tab stop, in 1000'th of cm.
'    nAlign - optional, if specified, must be one of...
'      **LEFT = 0
'      **CENTER = 1
'      **RIGHT = 2
'      **DECIMAL = 3
'      **DEFAULT = 4
'    cDecimalChar - optional, if specified, only applies to a DECIMAL tab
'                    and specified the character which is recognized as
'                    the decimal point separator.
'    cFillChar - optional, if specified, specifies the char that fills the
'                    between tab stops.
Function MakeTabStop( ByVal nPosition As Long,_
                         Optional nAlign,_
                         Optional cDecimalChar,_
                         Optional cFillChar _
                     ) As
     If IsMissing( nAlign ) Then
         nAlign =**LEFT

     oTabStop = createUnoStruct( "" )

     oTabStop.Position = nPosition
     oTabStop.Alignment = nAlign

     If Not IsMissing( cDecimalChar ) Then
         oTabStop.DecimalChar = cDecimalChar
     If Not IsMissing( cFillChar ) Then
         oTabStop.FillChar = cFillChar

     MakeTabStop() = oTabStop
End Function

   Hi :)
All i could find was this wiki-page**Common/About_Import_and_**Export_Filters<>
last updated in May so i think things are likely to have moved on quite a
lot!  Also i suspect there are add-ons/extensions that can add to the

I tried looking up release notes**download/release-notes/<>
which led me to
but there is not much detail listed in there.  mostly it seems
broad-brushstrokes rather than fine-grained detail .

Apols and regards from
Tom :)

View this message in context: http://nabble.****of-output-filters-Name-of-**
Sent from the Users mailing list archive at

For unsubscribe instructions e-mail to: users+help@global.libreoffice.**
Posting guidelines + more: http://wiki.****
List archive: 
All messages sent to this list will be publicly archived and cannot be

For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.