BookMaker.js 1.4 This is an option provided by BookMaker to generate PDF using Apache, PHP and PhantomJS on CentOS. To use PhantomJS, a dedicated server or VPS is needed. This won't work with shared hosting unless PhantomJS is supported. ***--------------------------------------*** ***Installing APACHE on VPS (Linux): *** ***--------------------------------------*** Install Apache if your VPS don't have Apached ready yet. 1. [prompt] yum -y install httpd 2. Then start apache and configure apache on boot time. [prompt] systemctl start httpd.service [prompt] systemctl enable httpd.service 3. Point your browser to http://your_vps_ip, this should show Apache default page. 4. If Apache default page is not shown, it may be blocked by firewall (CentOS 7), execute this command: [prompt] firewall-cmd --permanent --zone=public --add-service=http [prompt] firewall-cmd --permanent --zone=public --add-service=https [prompt] firewall-cmd --reload ***--------------------------------------*** ***Installing PHP on VPS (Linux): *** ***--------------------------------------*** Install PHP if your VPS don't have PHP ready yet. 1. [prompt] yum -y install php 2. Install PHP GD library [prompt] yum install gd gd-devel php-gd 3. Restart apache [prompt] systemctl restart httpd.service ***--------------------------------------*** ***Installing PhantomJS on VPS (Linux): *** ***--------------------------------------*** 1. Download PhantomJS binary distribution from PhantomJS.org. Select one that suitable for your system and upload to your server. 2. Extract the file, for example in Linux: [prompt] tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 3. Copy the extracted file into /usr/local/bin cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin Another alternative is create a symlink to the file ln -s phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs 4. Try run phantomjs [prompt] phantomjs phantomjs-2.1.1-linux-x86_64/examples/hello.js 4a. If you encounter error: phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory install the required library: [prompt] yum install fontconfig 4b. If you encounter error: phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory install the required library: [prompt] yum install freetype ***--------------------------------------*** ***Installing GhostScript on VPS (Linux):*** ***--------------------------------------*** For PDF generation, Ghostscript is needed, to install Ghostscript: [prompt] yum install ghostscript