最終更新:2012-08-06 (月) 02:55:46 (4274d)  

unoconv
Top / unoconv

OpenOffice.orgUNOを利用してMicrosoft OfficeとかOpenOffice.orgのファイルを変換する。

http://dag.wieers.com/home-made/unoconv/

unoconv converts between any document format that OpenOffice understands. It uses OpenOffice's UNO bindings for non-interactive conversion of documents.

Supported document formats include Open Document Format (.odt), MS Word (DOC), MS Office Open/MS OOXML (.xml), Portable Document Format (PDF), HTML, XHTML, RTF?, Docbook (.xml), and more.

インストール

  • DAGのリポジトリ(RPMforge)に入ってるのでそれを追加して
yum install unoconv

使い方

# unoconv test.ppt -f pdf
# unoconv -h
usage: unoconv [options] file [file2 ..]

Convert from and to any format supported by OpenOffice

unoconv options:
  -c, --connection=string  use a custom connection string
  -d, --doctype=type       specify document type
                           (document, graphics, presentation, spreadsheet)
  -f, --format=format      specify the output format
  -l, --listener           start a listener to use by unoconv clients
  -p, --port               specify the port (default: 2002) 
                           to be used by client or listener
  -s, --server             specify the server address (default: localhost)
                           to be used by client or listener
      --show               list the available output formats
      --stdout             write output to stdout
  -v, --verbose            be more and more verbose

ImageMagickでさらに変換(convert)

convert -thumbnail 200 input.pdf[0] output.png

サーバで使う場合

Xvfbを入れる

  • # yum groupinstall "X Window System"
    # yum install xorg-x11-server-Xvfb

Xvfbの起動

  • # export DISPLAY=:1.0
    # Xvfb :1 &

OpenOfficeをサーバとして起動

  • # unoconv –-listener &

変換

  • # unoconv test.ppt -f pdf

メモ

  • unoconv: UnoException during conversion: URL seems to be an unsupported one.

と出るときは必要なパッケージを入れる

  • openoffice.org-base
  • openoffice.org-calc
  • openoffice.org-core
  • openoffice.org-draw
  • openoffice.org-graphicfilter
  • openoffice.org-impress
  • openoffice.org-langpack-ja_JP
  • openoffice.org-math
  • openoffice.org-pyuno
  • openoffice.org-ure
  • openoffice.org-writer
  • openoffice.org-xsltfilter

Output formats

The following list of document formats are currently available for exporting to:

  • BIB? - BibTeX .bib?
  • DOC - Microsoft Word 97/2000/XP .doc
  • DOC6? - Microsoft Word 6.0 .doc
  • DOC95? - Microsoft Word 95? .doc
  • DOCBOOK? - DocBook .xml?
  • HTML - HTML Document (OpenOffice.org Writer) .html?
  • ODT? - Open Document Text .odt?
  • OTT - Open Document Text .ott?
  • OOXML - Microsoft Office Open XML .xml?
  • PDB? - AportisDoc? (Palm) .pdb
  • PDF - Portable Document Format .pdf?
  • PSW? - Pocket Word .psw?
  • RTF? - Rich Text Format .rtf?
  • LATEX? - LaTeX 2e .ltx?
  • SDW? - StarWriter? 5.0 .sdw?
  • SDW4? - StarWriter? 4.0 .sdw?
  • SDW3? - StarWriter? 3.0 .sdw?
  • STW? - OpenOffice.org 1.0 Text Document Template .stw?
  • SXW? - OpenOffice.org 1.0 Text Document .sxw?
  • TEXT - Text Encoded .txt?
  • TXT? - Plain Text .txt?
  • VOR? - StarWriter? 5.0 Template .vor?
  • VOR4? - StarWriter? 4.0 Template .vor?
  • VOR3? - StarWriter? 3.0 Template .vor?
  • XHTML - XHTML Document .html?

The following list of graphics formats are currently available for exporting to:

  • BMP - Windows Bitmap .bmp?
  • EMF? - Enhanced Metafile .emf?
  • EPS - Encapsulated PostScript .eps?
  • 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?
  • SXD3? - StarDraw? 3.0 .sxd?
  • SXD5? - StarDraw? 5.0 .sxd?
  • TIFF - Tagged Image File Format .tiff?
  • VOR? - StarDraw? 5.0 Template .vor?
  • VOR3? - StarDraw? 3.0 Template .vor?
  • WMF - Windows Metafile .wmf?
  • XHTML - XHTML .xhtml?
  • XPM? - X PixMap? .xpm?

The following list of presentation formats are currently available for exporting to:

  • BMP - Windows Bitmap .bmp?
  • EMF? - Enhanced Metafile .emf?
  • EPS - Encapsulated PostScript .eps?
  • GIF - Graphics Interchange Format .gif?
  • HTML - HTML Document (OpenOffice.org Impress) .html?
  • JPG - Joint Photographic Experts Group .jpg?
  • MET? - OS/2 Metafile .met?
  • ODD? - OpenDocument? Drawing (Impress) .odd?
  • ODG? - OpenOffice.org 1.0 Drawing (OpenOffice.org Impress) .odg?
  • ODP? - OpenDocument? Presentation .odp?
  • PBM? - Portable Bitmap .pbm?
  • PCT? - Mac Pict .pct?
  • PDF - Portable Document Format .pdf?
  • PGM - Portable Graymap .pgm?
  • PNG - Portable Network Graphic .png?
  • POT? - Microsoft PowerPoint 97/2000/XP Template .pot
  • PPM - Portable Pixelmap .ppm?
  • PPT - Microsoft PowerPoint 97/2000/XP .ppt
  • PWP? - PlaceWare? .pwp?
  • RAS - Sun Raster Image .ras?
  • SDA - StarDraw? 5.0 (OpenOffice.org Impress) .sda?
  • SDD? - StarImpress? 5.0 .sdd?
  • SDD3? - StarDraw? 3.0 (OpenOffice.org Impress) .sdd?
  • SDD4? - StarImpress? 4.0 .sdd?
  • STI? - OpenOffice.org 1.0 Presentation Template .sti?
  • STP - OpenDocument? Presentation Template .stp?
  • 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?
  • VOR? - StarImpress? 5.0 Template .vor?
  • VOR3? - StarDraw? 3.0 Template (OpenOffice.org Impress) .vor?
  • VOR4? - StarImpress? 4.0 Template .vor?
  • VOR5? - StarDraw? 5.0 Template (OpenOffice.org Impress) .vor?
  • WMF - Windows Metafile .wmf?
  • XHTML - XHTML .xml?
  • XPM? - X PixMap? .xpm?

The following list of spreadsheet formats are currently available for exporting to:

  • CSV - Text CSV .csv?
  • DBF? - dBase .dbf?
  • DIF? - Data Interchange Format .dif?
  • HTML - HTML Document (OpenOffice.org Calc) .html?
  • ODS? - Open Document Spreadsheet .ods?
  • OOXML - Microsoft Excel 2003 XML .xml?
  • PDF - Portable Document Format .pdf?
  • PTS - OpenDocument? Spreadsheet Template .pts?
  • PXL? - Pocket Excel .pxl?
  • SDC? - StarCalc? 5.0 .sdc?
  • SDC4? - StarCalc? 4.0 .sdc?
  • SDC3? - StarCalc? 3.0 .sdc?
  • SLK? - SYLK .slk?
  • STC? - OpenOffice.org 1.0 Spreadsheet Template .stc?
  • SXC? - OpenOffice.org 1.0 Spreadsheet .sxc?
  • VOR3? - StarCalc? 3.0 Template .vor?
  • VOR4? - StarCalc? 4.0 Template .vor?
  • VOR? - StarCalc? 5.0 Template .vor?
  • 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?

参考