dragon.PDF Converter – Installation Guide

Overview

dragon.PDF turns Word templates and JSON data into finished PDF documents with a single HTTP request. Generate PDF/A-2 or PDF/A-3 and receive the file directly in the response, or load a template BLOB from an Oracle source table and write the result directly to an Oracle target table.

Prerequisites

System Requirements

  • Operating System: Linux
  • Architecture: x86_64
  • Memory: Minimum 512MB RAM
  • Disk Space: 100MB free space
  • Network: HTTP port access (default: 6548)

Required Components

  1. Oracle User: The system must have an oracle user and oinstall group
  2. Oracle Database: Oracle 19c/21c with accessible service
  3. Root Access: Installation requires root privileges
  4. Ghostscript: PDF processing engine (usually installed at /usr/bin/gs)

Software Dependencies

Oracle Linux 8: Ghostscript, LibreOffice, and Fonts

This guide installs the Oracle-supported versions of Ghostscript and LibreOffice on Oracle Linux 8, together with English, German, and commonly required fonts.

Run all commands as root.

1. Update package metadata

dnf clean metadata
dnf makecache
dnf update -y

Confirm the required repositories are enabled:

dnf repolist --enabled | grep -E 'ol8_baseos|ol8_appstream'

Enable AppStream when necessary:

dnf install -y dnf-utils
dnf config-manager --enable ol8_appstream
dnf makecache

2. Install Oracle-supported Ghostscript

dnf install -y ghostscript

Verify:

gs --version
command -v gs
rpm -q ghostscript

The executable should normally be:

/usr/bin/gs

3. Install LibreOffice

dnf install -y \
  libreoffice \
  libreoffice-langpack-en \
  libreoffice-langpack-de \
  libreoffice-help-en \
  libreoffice-help-de \
  glibc-langpack-en \
  glibc-langpack-de

Install English and German spelling and autocorrection packages:

dnf install -y \
  hunspell-en \
  hunspell-de \
  autocorr-en \
  autocorr-de

Verify:

libreoffice --version
command -v libreoffice

rpm -q \
  libreoffice \
  libreoffice-langpack-en \
  libreoffice-langpack-de

4. Install standard open-source fonts

dnf install -y \
  fontconfig \
  liberation-fonts \
  liberation-sans-fonts \
  liberation-serif-fonts \
  liberation-mono-fonts \
  dejavu-sans-fonts \
  dejavu-serif-fonts

Rebuild the font cache:

fc-cache -f -v

Verify:

fc-match "Liberation Sans"
fc-match "DejaVu Sans"

Liberation Sans is a freely licensed substitute for Arial and has similar font metrics.

5. Install licensed Arial fonts

Arial is proprietary and is not included in the Oracle Linux repositories. Obtain the font files from a properly licensed Microsoft installation or another licensed source.

Typical files are:

arial.ttf
arialbd.ttf
ariali.ttf
arialbi.ttf

Copy the files to the server, for example into:

/root/arial-fonts

Install them system-wide:

mkdir -p /usr/local/share/fonts/microsoft/arial

find /root/arial-fonts -maxdepth 1 -type f \
  -iname 'arial*.ttf' \
  -exec install -m 0644 {} \
  /usr/local/share/fonts/microsoft/arial/ \;

chown -R root:root /usr/local/share/fonts/microsoft
restorecon -RF /usr/local/share/fonts/microsoft
fc-cache -f -v

Verify Arial:

fc-match Arial
fc-list | grep -i Arial

Expected output should reference an Arial font file, for example:

arial.ttf: "Arial" "Regular"

Do not download Arial from untrusted font websites.

6. Test LibreOffice headless conversion

Create a temporary output directory:

mkdir -p /tmp/libreoffice-output
mkdir -p /tmp/libreoffice-profile

Convert a DOCX file to PDF:

libreoffice \
  -env:UserInstallation=file:///tmp/libreoffice-profile \
  --headless \
  --convert-to pdf \
  --outdir /tmp/libreoffice-output \
  /path/to/document.docx

Check the output:

ls -lh /tmp/libreoffice-output
file /tmp/libreoffice-output/*.pdf

For German locale processing:

LANG=de_DE.UTF-8 libreoffice \
  -env:UserInstallation=file:///tmp/libreoffice-profile-de \
  --headless \
  --convert-to pdf \
  --outdir /tmp/libreoffice-output \
  /path/to/document.docx

For English locale processing:

LANG=en_US.UTF-8 libreoffice \
  -env:UserInstallation=file:///tmp/libreoffice-profile-en \
  --headless \
  --convert-to pdf \
  --outdir /tmp/libreoffice-output \
  /path/to/document.docx

7. Final verification

echo "Ghostscript:"
gs --version

echo "LibreOffice:"
libreoffice --version

echo "Arial:"
fc-match Arial

echo "German locale:"
locale -a | grep -i de_DE

echo "English locale:"
locale -a | grep -i en_US

Notes

  • Use the Oracle-supported packages from BaseOS and AppStream for compatibility and security updates.
  • Do not replace /usr/bin/gs with a manually compiled Ghostscript binary unless a specific newer feature is required.
  • Use a separate LibreOffice user profile for concurrent or automated conversions.
  • Restart any long-running LibreOffice service after installing new fonts.

Files Required for Installation

Ensure these files are in the same directory before installation:

installation/
+-- .env                  # environment for database connection
+-- install-service.sh    # Installation script
+-- dragon-pdf  # Main executable binary
+-- license.lic           # License file (see License Activation below)
+-- readme.md             # This file

set file rights and execution flag

chown -R oracle:oinstall /u01/dragon.PDF chmod +x dragon.PDF

set environment for local database connection

vim .env
# Database configuration (Oracle)
DB_HOST=localhost
DB_PORT=1521
DB_SERVICE_NAME=pdb1.manage.de
DB_USER=MIT_DRAGON_PDF
DB_PASSWORD=Apex4020
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
HTTP_HOST=127.0.0.1
HTTP_PORT=6548
LICENSE_FILE_PATH=/u01/dragon.PDF/license.lic
GHOSTSCRIPT_PATH=/usr/bin/gs
LIBRE_OFFICE_PATH=/usr/bin/soffice

License Activation

Before installation, you need to obtain a valid license file:

1. Generate Activation Code

Run the dragon-pdf binary to get your unique activation code:

./dragon-pdf

The activation code will be displayed on screen.

2. Request License File

  • Send your activation code to: manage.it GmbH
  • Contact information will be provided with your software purchase
  • You will receive a license.lic file in response

3. Place License File

Place the received license.lic file in the same directory as the installation script before proceeding with installation.

Installation Steps

1. Prepare Installation Files

# Navigate to the installation directory
cd /path/to/installation

# Verify all required files are present
ls -la
# Should show: install-service.sh, dragon-pdf, license.json

2. Make Installation Script Executable

chmod +x install-service.sh

3. Run Installation (as root)

sudo ./install-service.sh

4. Follow Interactive Configuration

The installer will prompt you for configuration values. Press Enter to use default values shown in brackets:

Database Configuration:

  • DB Host [localhost]: Oracle database hostname
  • DB Port [1521]: Oracle database port
  • DB Service Name [pdb1.manage.de]: Oracle service name
  • DB Webservice User [MIT_DRAGON_PDF]: Database username
  • DB Webservice Password [MIT_DRAGON_PDF]: Database password (hidden input)
  • NLS_LANG [AMERICAN_AMERICA.AL32UTF8]: Character encoding

Server Configuration:

  • Server Port [6548]: HTTP service port
  • Server Host [localhost]: Service bind address
  • Ghostscript Path [/usr/bin/gs]: Path to Ghostscript binary
  • License File [license.json]: License file name

Note: The installer will automatically detect Ghostscript at /usr/bin/gs. If it’s installed elsewhere, you’ll be prompted to enter the correct path.

5. Installation Complete

Upon successful installation, you’ll see:

? Service installed successfully!

Configuration saved to .env file
Binary copied and configured at /u01/dragon.PDF/dragon-pdf
License file copied to /u01/dragon.PDF/license.lic

Installation Directory Structure

After installation, the following structure will be created:

/u01/dragon.PDF/
+-- .env                    # Configuration file (secure permissions)
+-- dragon-pdf    # Main executable
+-- license.lic            # License file
+-- logs/                   # Log directory
    +-- dragon-pdf.log

Service Management

make sure the Program is executabale and Start Program Directly to get Licence Activation code

chmod +x dragon-pdf
sudo ./dragon-pdf

Start the Service

sudo systemctl start dragon-pdf

Stop the Service

sudo systemctl stop dragon-pdf

Check Service Status

sudo systemctl status dragon-pdf

View Service Logs

# Real-time logs
sudo journalctl -u dragon-pdf -f

# Recent logs
sudo journalctl -u dragon-pdf --since "1 hour ago"

Enable/Disable Auto-start

# Enable auto-start on boot (default)
sudo systemctl enable dragon-pdf

# Disable auto-start
sudo systemctl disable dragon-pdf

Configuration

Environment Variables (.env file)

Located at: /u01/dragon.PDF/.env

# Database configuration (Oracle)
DB_HOST=localhost
DB_PORT=1521
DB_SERVICE_NAME=pdb1.manage.de
DB_USER=pdf_conv
DB_PASSWORD=pdf_conv
NLS_LANG=AMERICAN_AMERICA.AL32UTF8

# Server configuration
SERVER_PORT=6548
SERVER_HOST=localhost

# PDF Processing
GS_PATH=/usr/bin/gs

LICENSE_FILE=license.json

Modifying Configuration

  1. Stop the service: sudo systemctl stop dragon-pdf
  2. Edit the .env file: sudo nano /u01/dragon.PDF/.env
  3. Start the service: sudo systemctl start dragon-pdf

Verify Database Connection

Check logs for database connectivity:

sudo journalctl -u dragon-pdf | grep -i database

Troubleshooting

Common Issues

1. Service Fails to Start

# Check detailed status
sudo systemctl status dragon-pdf -l

# Check logs
sudo journalctl -u dragon-pdf --since "10 minutes ago"

2. Database Connection Issues

  • Verify Oracle database is running
  • Check network connectivity: telnet DB_HOST DB_PORT
  • Verify credentials and service name
  • Check NLS_LANG setting

3. Permission Issues

# Fix ownership and permissions
sudo chown -R oracle:oinstall /u01/dragon.PDF
sudo chmod 755 /u01/dragon.PDF/dragon-pdf
sudo chmod 600 /u01/dragon.PDF/.env

4. Port Conflicts

# Check if port is in use
sudo netstat -tlnp | grep :6548

# Kill conflicting process if needed
sudo kill -9 <PID>

5. Ghostscript Issues

# Verify Ghostscript installation
gs --version
which gs

# Test Ghostscript functionality
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/tmp/test.pdf /dev/null

# Check service logs for Ghostscript errors
sudo journalctl -u dragon-pdf | grep -i ghostscript

Common Ghostscript Issues:

  • Ghostscript not found: Install using your package manager
  • Permission denied: Ensure the oracle user can execute Ghostscript
  • Wrong path: Update GS_PATH in .env file with correct path

Log Files

Monitor these log files for troubleshooting:

  • System logs: sudo journalctl -u dragon-pdf
  • Application logs: /u01/dragon.PDF/logs/

Uninstallation

To remove the service:

# Stop and disable service
sudo systemctl stop dragon-pdf
sudo systemctl disable dragon-pdf

# Remove service file
sudo rm /etc/systemd/system/dragon-pdf.service

# Reload systemd
sudo systemctl daemon-reload

# Optionally remove installation directory
sudo rm -rf /u01/dragon.PDF

Security Notes

  1. File Permissions: The .env file has restricted permissions (600) – only oracle user can read
  2. Database Credentials: Store securely and use strong passwords
  3. Network Security: Consider firewall rules for the service port
  4. Updates: Reinstall using the same process for updates

Licensing & Distribution Requirements

This software includes components licensed under:
- Apache License 2.0 (oracledb, cryptography)
- BSD 3-Clause License (python-dotenv)
- Python Software Foundation License (Python standard library)

Support

For issues and support:

  1. Check the troubleshooting section above
  2. Review log files for error messages
  3. Verify all prerequisites are met
  4. Ensure proper file permissions

Note: This installation creates a production-ready systemd service that will automatically start on system boot.