views:

1490

answers:

1

Has anyone used the CLI libraries from OpenOffice that allow to use it from a .NET application? I'm trying to save a document in HTML format in the following way.

You define a property that is passed as parameter to the save method. In this case I found the example to save the document as Microsoft Word 97, and it is done giving the property a name like "FilterName" and the string value "swriter: MS Word 97".

The issue is that they don't have documented what is the string value for saving as an HTML Document.

Here is the code:

 propertyValues[1] = new unoidl.com.sun.star.beans.PropertyValue();
 propertyValues[1].Name = "FilterName";
 propertyValues[1].Value = new uno.Any("swriter: MS Word 97");

 XStorable xStorable = xComponent as XStorable;
 xStorable.storeToURL(PathConverter(FileName), propertyValues);

Where can I find the source code of the OpenOffice so I can trace it?

+1  A: 

Using the following string "HTML (StarWriter)" as FilterName.

Value makes the export pretty well, Also found useful and working nice the PDF Filter Exporter "writer_pdf_Export".

Actually there is a List of all Export/Importers (I don't know if all works or if they need of plug-ins to work):

'AportisDoc Palm DB',
'BMP - MS Windows',
'CGM - Computer Graphics Metafile',
'DIF',
'DXF - AutoCAD Interchange',
'DocBook File',
'EMF - MS Windows Metafile',
'EPS - Encapsulated PostScript',
'Flat XML File',
'GIF - Graphics Interchange',
'HTML',
'HTML (StarCalc)',
'HTML (StarWriter)',
'JPG - JPEG',
'Lotus',
'MET - OS/2 Metafile',
'MS Excel 4.0',
'MS Excel 4.0 Vorlage/Template',
'MS Excel 5.0/95',
'MS Excel 5.0/95 Vorlage/Template',
'MS Excel 95',
'MS Excel 95 Vorlage/Template',
'MS Excel 97',
'MS Excel 97 Vorlage/Template',
'MS PowerPoint 97',
'MS PowerPoint 97 Vorlage',
'MS WinWord 6.0',
'MS Word 95',
'MS Word 95 Vorlage',
'MS Word 97',
'MS Word 97 Vorlage',
'MathML XML (Math)',
'MathType 3.x',
'Microsoft Word 2003 XML',
'PBM - Portable Bitmap',
'PCT - Mac Pict',
'PCX - Zsoft Paintbrush',
'PGM - Portable Graymap',
'PNG - Portable Network Graphic',
'PPM - Portable Pixelmap',
'PSD - Adobe Photoshop',
'RAS - Sun Rasterfile',
'Rich Text Format',
'Rich Text Format (StarCalc)',
'SGF - StarOffice Writer SGF',
'SGV - StarDraw 2.0',
'SVM - StarView Metafile',
'SYLK',
'StarCalc 1.0',
'StarCalc 3.0',
'StarCalc 3.0 Vorlage/Template',
'StarCalc 4.0',
'StarCalc 4.0 Vorlage/Template',
'StarCalc 5.0',
'StarCalc 5.0 Vorlage/Template',
'StarChart 3.0',
'StarChart 4.0',
'StarChart 5.0',
'StarDraw 3.0',
'StarDraw 3.0 (StarImpress)',
'StarDraw 3.0 Vorlage',
'StarDraw 3.0 Vorlage (StarImpress)',
'StarDraw 5.0',
'StarDraw 5.0 (StarImpress)',
'StarDraw 5.0 Vorlage',
'StarDraw 5.0 Vorlage (StarImpress)',
'StarImpress 4.0',
'StarImpress 4.0 Vorlage',
'StarImpress 5.0',
'StarImpress 5.0 (packed)',
'StarImpress 5.0 Vorlage',
'StarMath 2.0',
'StarMath 3.0',
'StarMath 4.0',
'StarMath 5.0',
'StarOffice XML (Calc)',
'StarOffice XML (Chart)',
'StarOffice XML (Draw)',
'StarOffice XML (Impress)',
'StarOffice XML (Math)',
'StarOffice XML (Writer)',
'StarWriter 1.0',
'StarWriter 2.0',
'StarWriter 3.0',
'StarWriter 3.0 (StarWriter/GlobalDocument)',
'StarWriter 3.0 (StarWriter/Web)',
'StarWriter 3.0 Vorlage/Template',
'StarWriter 4.0',
'StarWriter 4.0 (StarWriter/GlobalDocument)',
'StarWriter 4.0 (StarWriter/Web)',
'StarWriter 4.0 Vorlage/Template',
'StarWriter 4.0/GlobalDocument',
'StarWriter 5.0',
'StarWriter 5.0 (StarWriter/GlobalDocument)',
'StarWriter 5.0 (StarWriter/Web)',
'StarWriter 5.0 Vorlage/Template',
'StarWriter 5.0/GlobalDocument',
'StarWriter DOS',
'StarWriter/Web 4.0 Vorlage/Template',
'StarWriter/Web 5.0 Vorlage/Template',
'TGA - Truevision TARGA',
'TIF - Tag Image File',
'Text',
'Text (StarWriter/Web)',
'Text (encoded)',
'Text (encoded) (StarWriter/GlobalDocument)',
'Text (encoded) (StarWriter/Web)',
'Text - txt - csv (StarCalc)',
'WMF - MS Windows Metafile',
'XBM - X-Consortium',
'XHTML File',
'XPM',
'bmp_Export',
'bmp_Import',
'calc_HTML_WebQuery',
'calc_StarOffice_XML_Calc_Template',
'calc_pdf_Export',
'dBase',
'draw_PCD_Photo_CD_Base',
'draw_PCD_Photo_CD_Base16',
'draw_PCD_Photo_CD_Base4',
'draw_StarOffice_XML_Draw_Template',
'draw_bmp_Export',
'draw_emf_Export',
'draw_eps_Export',
'draw_flash_Export',
'draw_gif_Export',
'draw_html_Export',
'draw_jpg_Export',
'draw_met_Export',
'draw_pbm_Export',
'draw_pct_Export',
'draw_pdf_Export',
'draw_pgm_Export',
'draw_png_Export',
'draw_ppm_Export',
'draw_ras_Export',
'draw_svg_Export',
'draw_svm_Export',
'draw_tif_Export',
'draw_wmf_Export',
'draw_xpm_Export',
'dxf_Import',
'emf_Export',
'emf_Import',
'eps_Export',
'eps_Import',
'gif_Export',
'gif_Import',
'impress_StarOffice_XML_Draw',
'impress_StarOffice_XML_Impress_Template',
'impress_bmp_Export',
'impress_emf_Export',
'impress_eps_Export',
'impress_flash_Export',
'impress_gif_Export',
'impress_html_Export',
'impress_jpg_Export',
'impress_met_Export',
'impress_pbm_Export',
'impress_pct_Export',
'impress_pdf_Export',
'impress_pgm_Export',
'impress_png_Export',
'impress_ppm_Export',
'impress_ras_Export',
'impress_svg_Export',
'impress_svm_Export',
'impress_tif_Export',
'impress_wmf_Export',
'impress_xpm_Export',
'jpg_Export',
'jpg_Import',
'math_pdf_Export',
'met_Export',
'met_Import',
'pbm_Export',
'pbm_Import',
'pcd_Import_Base',
'pcd_Import_Base16',
'pcd_Import_Base4',
'pct_Export',
'pct_Import',
'pcx_Import',
'pgm_Export',
'pgm_Import',
'placeware_Export',
'png_Export',
'png_Import',
'ppm_Export',
'ppm_Import',
'psd_Import',
'ras_Export',
'ras_Import',
'sgf_Import',
'sgv_Import',
'svg_Export',
'svm_Export',
'svm_Import',
'tga_Import',
'tif_Export',
'tif_Import',
'wmf_Export',
'wmf_Import',
'writer_StarOffice_XML_Writer_Template',
'writer_globaldocument_StarOffice_XML_Writer',
'writer_globaldocument_StarOffice_XML_Writer_GlobalDocument',
'writer_globaldocument_pdf_Export',
'writer_pdf_Export',
'writer_web_HTML_help',
'writer_web_StarOffice_XML_Writer',
'writer_web_StarOffice_XML_Writer_Web_Template',
'writer_web_pdf_Export',
'xbm_Import',
'xpm_Export',
'xpm_Import'
jmayor