LoginSignup
1
1

More than 5 years have passed since last update.

make pdf with libreoffice

Last updated at Posted at 2017-05-22

各種ファイルのpdf化をlibreofficeで実行してみた.
出来具合はまぁまぁだけど, 文字さえちゃんと入ってればいいかな, というレベルならば割りと良い気がします.

参考

http://naruoga.hatenablog.com/entry/2015/12/21/201558#fn-936ec94d
http://qiita.com/motomiya326/items/c16038b670927468b89b
http://qiita.com/y_irabu/items/5d916562744b05c5fc82
https://www.libreoffice.org/get-help/install-howto/os-x/

PATH:
http://qiita.com/soarflat/items/d5015bec37f8a8254380
http://qiita.com/soarflat/items/09be6ab9cd91d366bf71
http://qiita.com/hirokishirai/items/5a529c8395c4b336bf31
http://qiita.com/magicant/items/d3bb7ea1192e63fba850

environment

mac osx 10.11 el capitan
LibreOffice 5.3.3.2

git

preparation

install

ここ
https://www.libreoffice.org/get-help/install-howto/os-x/
からdmgをDLして実行してinstall

set path

pathを通す.

emacs ~/.bash_profile
(or 
emacs ~/.bashr
)

で開いて

#libreoffice                                                                                                                                 
export PATH=$PATH:/Applications/LibreOffice.app/Contents/MacOS

を追加.

source ~/.bash_profile
(or
source ~/.bashr
)

でsourceコマンド実行して, PATHが通るようにする.
(ターミナルを一度閉じて再び開くだけではだめなことも)
これでsofficeで使える様になる

PATHを通すために環境変数の設定を理解する (Mac OS X)
.bash_profile ? .bashrc ? いろいろあるけどこいつらなにもの?

usage

doc2pdf(pathを通す前).
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf:writer_pdf_Export *.doc
doc2pdf(pathを通した後).
soffice --headless --convert-to pdf:writer_pdf_Export *.doc
version_check.
soffice --version
help.
soffice --help

result

pdf化するテストをしてみた

割りと良い感じに動いた拡張子

doc
html
ppt
pptx
rtf
txt
xls
xlsx

エラーが出たけど動いた拡張子

docx

エラーは出なかったけど一部がおかしかった拡張子

csv

変化なし

pdf

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1