Build a Spring Boot Document Preview Service with kkFileView

This guide introduces kkFileView, an open‑source Spring Boot solution for online preview of office, PDF, CAD, multimedia and text files, outlines its key features, provides documentation links, shows preview examples, and explains how to set up and run the service.

Java Architect Essentials
Java Architect Essentials
Java Architect Essentials
Build a Spring Boot Document Preview Service with kkFileView

The article presents kkFileView, an open‑source document preview platform built with Spring Boot that supports a wide range of file formats, offering a free alternative to commercial products such as Yongzhong Office, Office 365, and iDocV.

Project Features

Supports office, PDF, CAD and other office documents.

Renders plain‑text files such as txt, xml, md, java, php, py, js, css, etc.

Handles compressed archives like zip, rar, jar, tar, gzip.

Previews images (jpg, jpeg, png, gif, tif, tiff) with rotation, scaling and mirroring.

Built with Spring Boot for easy deployment.

Provides REST APIs for cross‑language and cross‑platform integration (Java, PHP, Python, Go, …).

Abstract preview service interface simplifies secondary development.

Released under the Apache license – fully open source.

Official Site and Documentation

Website: https://kkfileview.keking.cn

Online Demo

Demo URL (may be temporarily unavailable): https://file.keking.cn

Project Documentation

Detailed wiki: https://gitee.com/kekingcn/file-online-preview/wikis/pages

Chinese README: https://gitee.com/kekingcn/file-online-preview/blob/master/README.md

English README: https://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md

Preview Types

1. Text Preview

All common text formats are supported. Default enabled types include:

txt, html, htm, asp, jsp, xml, json, properties, md, gitignore, log, java, py, c, cpp, sql, sh, bat, m, bas, prg, cmd

2. Image Preview

Supports jpg, jpeg, png, gif, etc., with rotation, scaling and mirroring.

3. Word Document Preview

Supports doc and docx. Two modes are available: page‑by‑page image preview (better for large files) and PDF conversion preview (faster for intranet access).

4. PPT Preview

Supports ppt and pptx with the same two modes as Word.

5. PDF Preview

Both image‑based and PDF‑based preview modes are supported.

6. Excel Preview

7. Archive Preview

Supports zip, rar, jar, tar, gzip. Files inside the archive can be clicked to preview directly.

8. Multimedia Preview

Supports common audio and video formats (mp3, wav, mp4, flv).

9. CAD Preview

Supports DWG files with image and PDF modes.

Usage

Technology stack used by the project:

Spring Boot (reference guide)

Freemarker

Redisson

JODConverter

External dependencies (optional):

Redis (optional)

OpenOffice or LibreOffice (Windows bundled; Linux installed automatically via script; macOS requires manual installation)

Step 1: Clone the repository –

git clone https://github.com/kekingcn/file-online-preview.git

Step 2: Run the ServerMain class’s main method; after startup, open http://localhost:8012/ to verify the service is running.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaSpring Bootopen sourceREST APIfile conversionkkFileViewDocument Preview
Java Architect Essentials
Written by

Java Architect Essentials

Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.