Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Setup Guide for Open-Source File Preview Tool kkFileView

Tech 1

Tool Introduction

kkFileView is an open-source file conversion and online preview tool built on Spring Boot and OpenOffice. It supports a wide range of formats including doc, docx, ppt, pptx, xls, xlsx, zip, rar, mp4, mp3, and various text/code files like txt, html, xml, java, properties, sql, js, md, json, conf, ini, vue, php, py, bat, and gitignore. The latest compiled version requires access to a paid group, but an older free version (2.2.1) is available from the official hidden URL, and you can also compile the source code yourself using Maven.

Environment Requirements

  • Java Runtime Environment (JRE) 8 or later
  • OpenOffice or LibreOffice (OpenOffice is used here)
  • Compiled kkFileView package
  • Chinese font package (to avoid garbled characters)

Installation Steps

1. Java Installation

# Download JDK 8u202 from Huawei Cloud mirror
wget https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz

# Extract to /usr/local
mkdir -p /usr/local && tar -xzf jdk-8u202-linux-x64.tar.gz -C /usr/local/

# Configure environment variables in /etc/profile
echo 'export JAVA_HOME=/usr/local/jdk1.8.0_202' >> /etc/profile
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile
echo 'export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib' >> /etc/profile

# Apply changes and verify installation
source /etc/profile && java -version

2. OpenOffice Installation

# Download Apache OpenOffice 4.1.15 Chinese version from SourceForge
wget https://sourceforge.net/projects/openofficeorg.mirror/files/4.1.15/binaries/zh-CN/Apache_OpenOffice_4.1.15_Linux_x86-64_install-rpm_zh-CN.tar.gz

# Extract the installation package
tar -xzf Apache_OpenOffice_4.1.15_Linux_x86-64_install-rpm_zh-CN.tar.gz

# Install all RPM packages in the RPMS directory
cd zh-CN/RPMS && rpm -ivh *.rpm

# Install desktop integration package
cd desktop-integration && rpm -ivh openoffice4.1.15-freedesktop-menus-4.1.15-9813.noarch.rpm

# Verify OpenOffice installation
which soffice

3. kkFileView Installation

# Obtain the compiled package (version 4.3.0 here, can be compiled from GitHub source)
# Extract to /usr/local
tar -xzf kkFileView-4.3.0.tar.gz -C /usr/local/

# Start kkFileView
cd /usr/local/kkFileView-4.3.0/bin && sh startup.sh

# Check if port 8012 is listening
netstat -nltp | grep 8012

4. Chinese Font Configuration

# Download Chinese font package
wget http://kkfileview.keking.cn/fonts.zip

# Extract and move to system font directory
unzip fonts.zip && mv zhFonts /usr/share/fonts/

# Set font permissions
chmod -R 755 /usr/share/fonts/zhFonts/*

# Refresh font cache
cd /usr/share/fonts/zhFonts/ && mkfontscale && mkfontdir && fc-cache && fc-cache -fv

source /etc/profile

References

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.