2009-07-23 70 views
2

是否有人使用OpenOfficeCLI庫允許從.NET應用程序使用它? 我試圖用以下方式保存HTML格式的文檔。使用C#中的OpenOffice轉換文件格式

您可以定義一個作爲參數傳遞給save方法的屬性。 在這種情況下,我找到了將文檔保存爲Microsoft Word 97的示例,並且完成了該屬性的名稱,如「FilterName」和字符串值「swriter:MS Word 97」。

問題是,他們沒有記錄什麼是保存爲HTML文檔的字符串值。

下面是代碼:

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); 

我在哪裏可以找到的OpenOffice的源代碼,所以我可以跟蹤它?

回答

4

使用以下字符串「HTML(StarWriter)」作爲FilterName。

值使出口相當好,也發現有用和 工作很好的PDF過濾器導出器「writer_pdf_Export」。

居然還有所有出口/進口商的名單(我不知道 如果所有的作品或者他們需要插件的工作):

'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' 
+0

你有沒有得到這個工作?我正在嘗試類似的東西,並嘗試使用其中幾個FilterName的FilterName,但每次調用StoreToUrl或StoreAtUrl時都會引發ErrorCodeIOException。 – 2011-05-26 13:46:49