How to install Third Party Components for Documents App in Clinical Viewer
Disclaimer: the following tutorial attempts to install qpdf-12.2.0 and libreoffice-25.8.1 for HSCV2025.8
Examples for Installing qpdf
Linux & Ubuntu
# 1. Download qpdf-12.2.0 AppImage programatically, or manually from https://github.com/qpdf/qpdf/releases/tag/v12.2.0
wget -O qpdf-12.2.0.AppImage https://github.com/qpdf/qpdf/releases/download/v12.2.0/qpdf-12.2.0-x86_64.AppImage
# 2. Make the AppImage executable
chmod +x qpdf-12.2.0.AppImage
# 3. Add executable to system PATH as “qpdf”
sudo mv qpdf-12.2.0.AppImage /usr/local/bin/qpdf
# 4. Verify you’re now running version 12.2.0
qpdf --version
# If running into "AppImages require FUSE to run"
sudo apt install libfuse2
Windows
# Run as Administrator in PowerShell
# 1. Download qpdf-12.2.0 MSVC Installer (example below uses 64bit)
# For other machines, check out https://github.com/qpdf/qpdf/releases/tag/v12.2.0 and replace with appropriate .exe file
cd $env:TEMP
Invoke-WebRequest `
-Uri "https://github.com/qpdf/qpdf/releases/download/v12.2.0/qpdf-12.2.0-msvc64.exe" `
-OutFile "qpdf-12.2.0-msvc64.exe"
# 2. Install from EXE silently
$installFile = Join-Path $env:TEMP "qpdf-12.2.0-msvc64.exe"
$installDir = "C:\Program Files\qpdf"
Start-Process -FilePath $installFile `
-ArgumentList "/S","/D=$installDir" `
-Verb RunAs -Wait
# 3. Add qpdf's bin folder to system PATH
$binDir = "C:\Program Files\qpdf\bin"
$mp = [Environment]::GetEnvironmentVariable("Path","Machine")
if ($mp -notmatch [regex]::Escape($binDir)) {
$new = "$mp;$binDir"
[Environment]::SetEnvironmentVariable("Path",$new,"Machine")
}
# 4. Reload updated PATH into current session
$env:Path = [Environment]::GetEnvironmentVariable('Path','Machine')
# 5. Verify you're now running version 12.2.0
qpdf --version
Examples for installing libreoffice
Note
- If download from terminal does not work, check out official release and select LibreOffice 25.8.1 for your OS
- If www.libreoffice.org is blocked by your firewall, download the install file locally, copy it to the vm, then run
mv ~/path/to/install_file $TMPDIR/install_filefor linux/ubuntu ormv ~\path\to\install_file $env:TEMP\install_filefor windows. - For internal testing, when downloading the install file your local OS may auto uncompress gzip. If you run into "not in gzip format", try remove the
zflag fromtar -zxf. - If you run into "error while loading shared libraries, install the required libraries as followed.
- install command
- Linux:
sudo dnf install - Ubuntu:
sudo apt install
- Linux:
- dependencies
- libcups2
- libcairo2
- libX11-xcb for linux or libx11-xcb1 for ubuntu
- libXinerama for linux or libxinerama1 for ubuntu
- install command
Linux
# 1. Download LibreOffice 25.8.1 bundle
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
wget -qO "$TMPDIR/LibreOffice_25.8.1.rpm.tar.gz" https://www.libreoffice.org/donate/dl/rpm-x86_64/25.8.1/en-US/LibreOffice_25.8.1_Linux_x86-64_rpm.tar.gz
# 2. Unzip LibreOffice 25.8.1 bundle
tar -zxf "$TMPDIR/LibreOffice_25.8.1.rpm.tar.gz" -C "$TMPDIR"
# 3.1 Install RPMs RHEL
sudo dnf install -y "$TMPDIR"/LibreOffice_*/*/*.rpm
# 3.2 Install RPMs Suse
sudo zypper --no-refresh --allow-unsigned-rpm -y install "$TMPDIR"/LibreOffice_*/*/*.rpm
# 4. Add executable to system PATH
echo 'export PATH=/opt/libreoffice25.8/program:$PATH' >> ~/.bashrc
source ~/.bashrc
# 5. Verify you’re now running version 25.8.1
soffice --version
Ubuntu
# 1. Download LibreOffice 25.8.1 bundle
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
wget -qO "$TMPDIR/LibreOffice_25.8.1.deb.tar.gz" https://www.libreoffice.org/donate/dl/deb-x86_64/25.8.1/en-US/LibreOffice_25.8.1_Linux_x86-64_deb.tar.gz
# 2. Unzip LibreOffice 25.8.1 bundle
tar -zxf "$TMPDIR/LibreOffice_25.8.1.deb.tar.gz" -C "$TMPDIR"
# 3. Install DEBs
sudo dpkg -i "$TMPDIR"/LibreOffice_*/*/*.deb
# 4. Add executable to system PATH
echo 'export PATH=/opt/libreoffice25.8/program:$PATH' >> ~/.bashrc
source ~/.bashrc
# 5. Verify you’re now running version 25.8.1
soffice --version
Windows
# Run as Administrator in PowerShell
# 1. Download the MSI to Temp directory
cd $env:TEMP
# $msiUrl = 'https://www.libreoffice.org/donate/dl/win-x86_64/25.8.1/en-US/LibreOffice_25.8.1_Win_x86-64.msi'
# $msiPath = Join-Path $env:TEMP 'LibreOffice_25.8.1.msi'
Invoke-WebRequest `
-Uri https://www.libreoffice.org/donate/dl/win-x86_64/25.8.1/en-US/LibreOffice_25.8.1_Win_x86-64.msi `
-OutFile "LibreOffice_25.8.1.msi"
# 2. Install from MSI silently
Start-Process msiexec.exe `
-ArgumentList '/i "LibreOffice_25.8.1.msi" /qn /norestart' `
-Wait
# 3. Add LibreOffice's program folder to system PATH
$loBin = 'C:\Program Files\LibreOffice\program'
$mp = [Environment]::GetEnvironmentVariable('Path','Machine')
if ($mp -notmatch [regex]::Escape($loBin)) {
[Environment]::SetEnvironmentVariable('Path', "$mp;$loBin", 'Machine')
}
# 4. Reload updated PATH into current session
$env:Path = [Environment]::GetEnvironmentVariable('Path','Machine')
# 5. Verify you’re now running version 25.8.1
soffice --version
Configuring both TPCs for IRIS
# Log into IRIS terminals of Clinical Viewer Instances with system user
# 1. Go into viewer namespace
zn "HSVIEWER"
# 2. Set version for LibreOffice(soffice)
do ##class(HS.DocumentViewer.Settings).StoreProgramConfig("soffice","25.8")
# 3. Set version for qpdf
do ##class(HS.DocumentViewer.Settings).StoreProgramConfig("qpdf","12.2")
# Note: only use "<major>.<minor>" for the second argument of StoreProgramConfig()
Discussion (0)0