linux如何查看office文件格式,在Linux上,如何在LibreOffice和Microsoft Office文件格式之间转换文档...

在此配置中,您可以学习如何在Linux上的LibreOffice和Microsoft Office文件格式之间转换文档格式。在LibreOffice和Microsoft Office之间进行文件格式转换的首选工具是unoconv。让我们开始安装unoconv包:

FEDORA/REDHAT/CENTOS

# yum install unoconv

DEBIAN/UBUNTU

# apt-get install unoconv

并创建一些LibreOffice文档document.odt和电子表格spreadsheet.ods和玩:

$ file document.odt

document.odt: OpenDocument Text

$ file spreadsheet.ods

spreadsheet.ods: OpenDocument Spreadsheet

的unoconv命令能够在各种文件格式之间转换。要查看所有受支持的文件格式的列表,请按照unoconv跑:

$ unoconv --show

The following list of document formats are currently available:

bib - BibTeX [.bib]

doc - Microsoft Word 97/2000/XP [.doc]

doc6 - Microsoft Word 6.0 [.doc]

doc95 - Microsoft Word 95 [.doc]

docbook - DocBook [.xml]

docx - Microsoft Office Open XML [.docx]

docx7 - Microsoft Office Open XML [.docx]

fodt - OpenDocument Text (Flat XML) [.fodt]

html - HTML Document (OpenOffice.org Writer) [.html]

latex - LaTeX 2e [.ltx]

mediawiki - MediaWiki [.txt]

odt - ODF Text Document [.odt]

ooxml - Microsoft Office Open XML [.xml]

ott - Open Document Text [.ott]

pdf - Portable Document Format [.pdf]

rtf - Rich Text Format [.rtf]

stw - Open Office.org 1.0 Text Document Template [.stw]

sxw - Open Office.org 1.0 Text Document [.sxw]

text - Text Encoded [.txt]

txt - Text [.txt]

uot - Unified Office Format text [.uot]

xhtml - XHTML Document [.html]

The following list of graphics formats are currently available:

bmp - Windows Bitmap [.bmp]

emf - Enhanced Metafile [.emf]

eps - Encapsulated PostScript [.eps]

fodg - OpenDocument Drawing (Flat XML) [.fodg]

gif - Graphics Interchange Format [.gif]

html - HTML Document (OpenOffice.org Draw) [.html]

jpg - Joint Photographic Experts Group [.jpg]

met - OS/2 Metafile [.met]

odd - OpenDocument Drawing [.odd]

otg - OpenDocument Drawing Template [.otg]

pbm - Portable Bitmap [.pbm]

pct - Mac Pict [.pct]

pdf - Portable Document Format [.pdf]

pgm - Portable Graymap [.pgm]

png - Portable Network Graphic [.png]

ppm - Portable Pixelmap [.ppm]

ras - Sun Raster Image [.ras]

std - OpenOffice.org 1.0 Drawing Template [.std]

svg - Scalable Vector Graphics [.svg]

svm - StarView Metafile [.svm]

swf - Macromedia Flash (SWF) [.swf]

sxd - OpenOffice.org 1.0 Drawing [.sxd]

tiff - Tagged Image File Format [.tiff]

wmf - Windows Metafile [.wmf]

xhtml - XHTML [.xhtml]

xpm - X PixMap [.xpm]

The following list of presentation formats are currently available:

bmp - Windows Bitmap [.bmp]

emf - Enhanced Metafile [.emf]

eps - Encapsulated PostScript [.eps]

fodp - OpenDocument Presentation (Flat XML) [.fodp]

gif - Graphics Interchange Format [.gif]

html - HTML Document (OpenOffice.org Impress) [.html]

jpg - Joint Photographic Experts Group [.jpg]

met - OS/2 Metafile [.met]

odg - ODF Drawing (Impress) [.odg]

odp - ODF Presentation [.odp]

otp - ODF Presentation Template [.otp]

pbm - Portable Bitmap [.pbm]

pct - Mac Pict [.pct]

pdf - Portable Document Format [.pdf]

pgm - Portable Graymap [.pgm]

png - Portable Network Graphic [.png]

potm - Microsoft PowerPoint 2007/2010 XML Template [.potm]

pot - Microsoft PowerPoint 97/2000/XP Template [.pot]

ppm - Portable Pixelmap [.ppm]

pptx - Microsoft PowerPoint 2007/2010 XML [.pptx]

pps - Microsoft PowerPoint 97/2000/XP (Autoplay) [.pps]

ppt - Microsoft PowerPoint 97/2000/XP [.ppt]

pwp - PlaceWare [.pwp]

ras - Sun Raster Image [.ras]

sda - StarDraw 5.0 (OpenOffice.org Impress) [.sda]

sxd - OpenOffice.org 1.0 Drawing (OpenOffice.org Impress) [.sxd]

sti - OpenOffice.org 1.0 Presentation Template [.sti]

svg - Scalable Vector Graphics [.svg]

svm - StarView Metafile [.svm]

swf - Macromedia Flash (SWF) [.swf]

sxi - OpenOffice.org 1.0 Presentation [.sxi]

tiff - Tagged Image File Format [.tiff]

uop - Unified Office Format presentation [.uop]

wmf - Windows Metafile [.wmf]

xhtml - XHTML [.xml]

xpm - X PixMap [.xpm]

The following list of spreadsheet formats are currently available:

csv - Text CSV [.csv]

dbf - dBASE [.dbf]

dif - Data Interchange Format [.dif]

fods - OpenDocument Spreadsheet (Flat XML) [.fods]

html - HTML Document (OpenOffice.org Calc) [.html]

ods - ODF Spreadsheet [.ods]

ooxml - Microsoft Excel 2003 XML [.xml]

ots - ODF Spreadsheet Template [.ots]

pdf - Portable Document Format [.pdf]

slk - SYLK [.slk]

stc - OpenOffice.org 1.0 Spreadsheet Template [.stc]

sxc - OpenOffice.org 1.0 Spreadsheet [.sxc]

uos - Unified Office Format spreadsheet [.uos]

xhtml - XHTML [.xhtml]

xls - Microsoft Excel 97/2000/XP [.xls]

xls5 - Microsoft Excel 5.0 [.xls]

xls95 - Microsoft Excel 95 [.xls]

xlt - Microsoft Excel 97/2000/XP Template [.xlt]

xlt5 - Microsoft Excel 5.0 Template [.xlt]

xlt95 - Microsoft Excel 95 Template [.xlt]

默认情况下,所有文档都转换为PDF。采用--format选项将输出文件格式更改为上面列出的任何格式。 Unoconv的-d用于显式指定文档类型,例如。文档,图形,演示文稿和电子表格。以下是一些如何在LibreOffice和Microsoft Office文档以及电子表格文件格式之间进行转换的示例。

将文档ODF转换为DOCX

$ unoconv -d document --format=docx document.odt

$ file document.docx

document.docx: Microsoft Word 2007+

将文档ODF转换为DOC

$ unoconv -d document --format=doc document.odt

$ file document.doc

document.doc: Composite Document File V2 Document, Little Endian, Os: Windows

将电子表格ODS转换为XLS

$ unoconv -d spreadsheet --format=xls spreadsheet.ods

$ file spreadsheet.xls

spreadsheet.xls: Composite Document File V2 Document, Little Endian, Os: Windows

将文档DOCX转换为ODF

$ unoconv -d document --format=odt document.docx

$ file document.odt

document.odt: OpenDocument Text

将电子表格XLS转换为ODS

$ unoconv -d spreadsheet --format=ods spreadsheet.xls

$ file spreadsheet.ods

spreadsheet.ods: OpenDocument Spreadsheet

### PyCharm 打开文件显示全的解决方案 当遇到PyCharm打开文件显示全的情况时,可以尝试以下几种方法来解决问题。 #### 方法一:清理缓存并重启IDE 有时IDE内部缓存可能导致文件加载异常。通过清除缓存再启动程序能够有效改善此状况。具体操作路径为`File -> Invalidate Caches / Restart...`,之后按照提示完成相应动作即可[^1]。 #### 方法二:调整编辑器字体设置 如果是因为字体原因造成的内容显示问题,则可以通过修改编辑区内的文字样式来进行修复。进入`Settings/Preferences | Editor | Font`选项卡内更改合适的字号大小以及启用抗锯齿功能等参数配置[^2]。 #### 方法三:检查项目结构配置 对于某些特定场景下的源码视图缺失现象,可能是由于当前工作空间未能正确识别全部模块所引起。此时应该核查Project Structure的Content Roots设定项是否涵盖了整个工程根目录;必要时可手动添加遗漏部分,并保存变更生效[^3]。 ```python # 示例代码用于展示如何获取当前项目的根路径,在实际应用中可根据需求调用该函数辅助排查问题 import os def get_project_root(): current_file = os.path.abspath(__file__) project_dir = os.path.dirname(current_file) while not os.path.exists(os.path.join(project_dir, '.idea')): parent_dir = os.path.dirname(project_dir) if parent_dir == project_dir: break project_dir = parent_dir return project_dir print(f"Current Project Root Directory is {get_project_root()}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值