ppt->pdf の変換をAmazon Linux上で実施する

はじめに

Amazon Linux上でppt->pdf変換をする為に、LibreOfficeを導入する手順を以下に記載する。 最新のAMIにてインスタンス起動後、パッケージを最新化し、依存関係のあるパッケージを追加インストールする。

環境

  • AMI version : amzn-ami-hvm-2015.03.0.x86_64-gp2

インストール対象

インストール手順

1.Libreofficeの安定版のダウンロード

[ec2-user@HOSTNAME ~]$ sudo wget http://ftp.yz.yamagata-u.ac.jp/pub/tdf/libreoffice/stable/4.4.5/rpm/x86_64/LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz
--2015-07-30 15:49:58--  http://ftp.yz.yamagata-u.ac.jp/pub/tdf/libreoffice/stable/4.4.5/rpm/x86_64/LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz
ftp.yz.yamagata-u.ac.jp (ftp.yz.yamagata-u.ac.jp) をDNSに問いあわせています... 133.24.255.153, 2001:df0:25e:e100::2
ftp.yz.yamagata-u.ac.jp (ftp.yz.yamagata-u.ac.jp)|133.24.255.153|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 229543691 (219M) [application/x-gzip]
`LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz' に保存中

LibreOffice_4.4.5_Linux_x86-64_rpm.tar. 100%[=================================================================================>] 218.91M  10.4MB/s 時間 17s    

2015-07-30 15:50:15 (13.2 MB/s) - `LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz' へ保存完了 [229543691/229543691]

[ec2-user@HOSTNAME ~]$ ls -l
合計 224168
-rw-r--r-- 1 root root 229543691  7月 26 20:45 LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz

2.LibreOfficeインストール

[ec2-user@HOSTNAME ~]$ tar xvzf LibreOffice_4.4.5_Linux_x86-64_rpm.tar.gz
[ec2-user@HOSTNAME ~]$ cd LibreOffice_4.4.5.2_Linux_x86-64_rpm/RPMS
[ec2-user@HOSTNAME RPMS]$ ls -l
合計 227896
-rw-rw-r-- 1 ec2-user ec2-user   2009269  7月 22 23:35 libobasis4.4-base-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user  10512363  7月 22 23:35 libobasis4.4-calc-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user 136276871  7月 22 23:39 libobasis4.4-core-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      5840  7月 22 23:34 libobasis4.4-draw-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     90267  7月 22 23:35 libobasis4.4-en-US-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     24592  7月 22 23:34 libobasis4.4-en-US-base-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     53113  7月 22 23:39 libobasis4.4-en-US-calc-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     17581  7月 22 23:35 libobasis4.4-en-US-math-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    198259  7月 22 23:35 libobasis4.4-en-US-res-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2578  7月 22 23:39 libobasis4.4-en-US-writer-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    272463  7月 22 23:35 libobasis4.4-extension-beanshell-script-provider-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    607734  7月 22 23:34 libobasis4.4-extension-javascript-script-provider-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   2967421  7月 22 23:35 libobasis4.4-extension-mediawiki-publisher-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   1126661  7月 22 23:39 libobasis4.4-extension-nlpsolver-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    911712  7月 22 23:35 libobasis4.4-extension-pdf-import-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   3454117  7月 22 23:39 libobasis4.4-extension-report-builder-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     49135  7月 22 23:39 libobasis4.4-filter-data-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    516463  7月 22 23:34 libobasis4.4-gnome-integration-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   3819458  7月 22 23:39 libobasis4.4-graphicfilter-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user  10498395  7月 22 23:34 libobasis4.4-images-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   1101371  7月 22 23:35 libobasis4.4-impress-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    135292  7月 22 23:39 libobasis4.4-kde-integration-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    127168  7月 22 23:34 libobasis4.4-librelogo-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    528172  7月 22 23:34 libobasis4.4-math-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    119110  7月 22 23:39 libobasis4.4-ogltrans-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    175537  7月 22 23:39 libobasis4.4-onlineupdate-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user  17938837  7月 22 23:35 libobasis4.4-ooofonts-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2535  7月 22 23:40 libobasis4.4-ooolinguistic-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   1576354  7月 22 23:39 libobasis4.4-postgresql-sdbc-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user     12591  7月 22 23:39 libobasis4.4-python-script-provider-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user  11134454  7月 22 23:40 libobasis4.4-pyuno-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   5355887  7月 22 23:35 libobasis4.4-writer-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    448351  7月 22 23:35 libobasis4.4-xsltfilter-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user    458249  7月 22 23:39 libreoffice4.4-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2150  7月 22 23:40 libreoffice4.4-base-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2149  7月 22 23:35 libreoffice4.4-calc-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   6573937  7月 22 23:34 libreoffice4.4-dict-en-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   1381515  7月 22 23:39 libreoffice4.4-dict-es-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   2236196  7月 22 23:39 libreoffice4.4-dict-fr-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2151  7月 22 23:34 libreoffice4.4-draw-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      7701  7月 22 23:35 libreoffice4.4-en-US-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   6500542  7月 22 22:11 libreoffice4.4-freedesktop-menus-4.4.5-2.noarch.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2177  7月 22 23:34 libreoffice4.4-impress-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2150  7月 22 23:34 libreoffice4.4-math-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user   4029793  7月 22 23:34 libreoffice4.4-ure-4.4.5.2-2.x86_64.rpm
-rw-rw-r-- 1 ec2-user ec2-user      2169  7月 22 23:34 libreoffice4.4-writer-4.4.5.2-2.x86_64.rpm

[ec2-user@HOSTNAME RPMS]$ rm libobasis4.4-gnome-integration-4.4.5.2-2.x86_64.rpm 

[ec2-user@HOSTNAME RPMS]$ sudo yum install *.rpm
読み込んだプラグイン:priorities, update-motd, upgrade-helper
libobasis4.4-base-4.4.5.2-2.x86_64.rpm を調べています: libobasis4.4-base-4.4.5.2-2.x86_64
…
インストール:
  libobasis4.4-base.x86_64 0:4.4.5.2-2                                           libobasis4.4-calc.x86_64 0:4.4.5.2-2                                           
  libobasis4.4-core.x86_64 0:4.4.5.2-2                                           libobasis4.4-draw.x86_64 0:4.4.5.2-2                                           
  libobasis4.4-en-US.x86_64 0:4.4.5.2-2                                          libobasis4.4-en-US-base.x86_64 0:4.4.5.2-2                                     
  libobasis4.4-en-US-calc.x86_64 0:4.4.5.2-2                                     libobasis4.4-en-US-math.x86_64 0:4.4.5.2-2                                     
  libobasis4.4-en-US-res.x86_64 0:4.4.5.2-2                                      libobasis4.4-en-US-writer.x86_64 0:4.4.5.2-2                                   
  libobasis4.4-extension-beanshell-script-provider.x86_64 0:4.4.5.2-2            libobasis4.4-extension-javascript-script-provider.x86_64 0:4.4.5.2-2           
  libobasis4.4-extension-mediawiki-publisher.x86_64 0:4.4.5.2-2                  libobasis4.4-extension-nlpsolver.x86_64 0:4.4.5.2-2                            
  libobasis4.4-extension-pdf-import.x86_64 0:4.4.5.2-2                           libobasis4.4-extension-report-builder.x86_64 0:4.4.5.2-2                       
  libobasis4.4-filter-data.x86_64 0:4.4.5.2-2                                    libobasis4.4-graphicfilter.x86_64 0:4.4.5.2-2                                  
  libobasis4.4-images.x86_64 0:4.4.5.2-2                                         libobasis4.4-impress.x86_64 0:4.4.5.2-2                                        
  libobasis4.4-kde-integration.x86_64 0:4.4.5.2-2                                libobasis4.4-librelogo.x86_64 0:4.4.5.2-2                                      
  libobasis4.4-math.x86_64 0:4.4.5.2-2                                           libobasis4.4-ogltrans.x86_64 0:4.4.5.2-2                                       
  libobasis4.4-onlineupdate.x86_64 0:4.4.5.2-2                                   libobasis4.4-ooofonts.x86_64 0:4.4.5.2-2                                       
  libobasis4.4-ooolinguistic.x86_64 0:4.4.5.2-2                                  libobasis4.4-postgresql-sdbc.x86_64 0:4.4.5.2-2                                
  libobasis4.4-python-script-provider.x86_64 0:4.4.5.2-2                         libobasis4.4-pyuno.x86_64 0:4.4.5.2-2                                          
  libobasis4.4-writer.x86_64 0:4.4.5.2-2                                         libobasis4.4-xsltfilter.x86_64 0:4.4.5.2-2                                     
  libreoffice4.4.x86_64 0:4.4.5.2-2                                              libreoffice4.4-base.x86_64 0:4.4.5.2-2                                         
  libreoffice4.4-calc.x86_64 0:4.4.5.2-2                                         libreoffice4.4-dict-en.x86_64 0:4.4.5.2-2                                      
  libreoffice4.4-dict-es.x86_64 0:4.4.5.2-2                                      libreoffice4.4-dict-fr.x86_64 0:4.4.5.2-2                                      
  libreoffice4.4-draw.x86_64 0:4.4.5.2-2                                         libreoffice4.4-en-US.x86_64 0:4.4.5.2-2                                        
  libreoffice4.4-freedesktop-menus.noarch 0:4.4.5-2                              libreoffice4.4-impress.x86_64 0:4.4.5.2-2                                      
  libreoffice4.4-math.x86_64 0:4.4.5.2-2                                         libreoffice4.4-ure.x86_64 0:4.4.5.2-2                                          
  libreoffice4.4-writer.x86_64 0:4.4.5.2-2                                      

依存性関連をインストールしました:
  libXdamage.x86_64 0:1.1.3-4.7.amzn1                 libXfixes.x86_64 0:5.0.1-2.1.8.amzn1                   libXinerama.x86_64 0:1.1.2-2.7.amzn1             
  libXxf86vm.x86_64 0:1.1.3-2.1.9.amzn1               libdrm.x86_64 0:2.4.52-4.12.amzn1                      libpciaccess.x86_64 0:0.13.1-4.1.11.amzn1        
  mesa-dri-drivers.x86_64 0:10.1.2-2.32.amzn1         mesa-dri-filesystem.x86_64 0:10.1.2-2.32.amzn1         mesa-dri1-drivers.x86_64 0:7.11-8.7.amzn1        
  mesa-libGL.x86_64 0:10.1.2-2.32.amzn1               mesa-libGLU.x86_64 0:10.1.2-2.32.amzn1                

完了しました!

3.変換に必要な依存パッケージのインストール

[ec2-user@HOSTNAME ~]$ yum list | grep cups-libs
cups-libs.i686                      1:1.4.2-67.21.amzn1            amzn-updates 
cups-libs.x86_64                    1:1.4.2-67.21.amzn1            amzn-updates 

[ec2-user@HOSTNAME ~]$ sudo yum install cups-libs
読み込んだプラグイン:priorities, update-motd, upgrade-helper
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ cups-libs.x86_64 1:1.4.2-67.21.amzn1 を インストール
…
インストール:
  cups-libs.x86_64 1:1.4.2-67.21.amzn1                                                                                                                          

依存性関連をインストールしました:
  avahi-libs.x86_64 0:0.6.25-12.17.amzn1    gnutls.x86_64 0:2.8.5-14.13.amzn1    jbigkit-libs.x86_64 0:2.0-11.4.amzn1    libtiff.x86_64 0:4.0.3-20.20.amzn1   

完了しました!

[ec2-user@HOSTNAME ~]$ yum list | grep dbus-glib
dbus-glib.i686                      0.86-6.10.amzn1                amzn-main    
dbus-glib.x86_64                    0.86-6.10.amzn1                amzn-main    
dbus-glib-devel.x86_64              0.86-6.10.amzn1                amzn-main    

[ec2-user@HOSTNAME ~]$ sudo yum install dbus-glib
読み込んだプラグイン:priorities, update-motd, upgrade-helper
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ dbus-glib.x86_64 0:0.86-6.10.amzn1 を インストール
…
インストール:
  dbus-glib.x86_64 0:0.86-6.10.amzn1                                                                                                                            

完了しました!

4.変換

[ec2-user@HOSTNAME ~]$ /opt/libreoffice4.4/program/soffice.bin --headless --convert-to pdf test.pptx
convert /home/ec2-user/test.pptx -> /home/ec2-user/test.pdf using filter : impress_pdf_Export

参考URL