We recommend an online document preview solution built with Spring Boot:

KkFileView, a mature and open source document online preview project solution, the standard industry paid products are [yongzhongoffice] [Office365] [IDOCV] and so on, free!

Project features

  1. Support Office, PDF, CAD and other office documents

  2. Support TXT, XML (render), MD (render), Java, PHP, PY, JS, CSS and so on all plain text

  3. Supports zip, RAR, JAR, tar, and gzip packages

  4. JPG, JPEG, PNG, GIF, TIF, TIFF and other image preview (flip, zoom, mirror)

  5. With Spring-Boot development, the preview service setup and deployment is very easy

  6. Rest interfaces provide services, cross-language, cross-platform features (Java, PHP, Python, Go, PHP,….) Both support, easy application access

  7. Abstract preview service interface, convenient secondary development, very convenient to add other types of file preview support

  8. The most important Apache protocol open source, code pull down to do what you want

Official website and Documentation

Address: kkfileview. Keking. Cn

Online experience

It will be stopped from time to time

Address: file. Keking. Cn

Project Documentation

  1. Detailed wiki documentation: gitee.com/kekingcn/fi…

  2. English: gitee.com/kekingcn/fi…

  3. English document:gitee.com/kekingcn/fi…

Document Preview effect

1. Text preview

Supports all types of text document preview. Because there are too many text document types to enumerate all text document types, the following types are enabled by default

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

The text preview looks like this

The text preview looks like this

2. Image preview

JPG, JPEG, PNG, GIF and other image preview (flip, zoom, mirror), the preview effect is as follows

Preview picture

3. Preview the Word document

Support doc, DOCX document preview, Word preview has two modes: one is every word page to picture preview, the other is the whole Word document to PDF, and then preview PDF. The application scenarios of the two modes are as follows

  • Image preview: Word files are too large and the front end is too slow to load the entire PDF

  • PDF preview: Intranet access, fast loading PDF

Image preview mode The preview effect is as follows

Word Document Preview 1

PDF Preview mode The preview effect is as follows

Word Document Preview 2

4. PPT document preview

Support PPT, PPTX document preview, and Word document, there are two preview modes

Image preview mode The preview effect is as follows

PPT Document preview 1

PDF Preview mode The preview effect is as follows

PPT Document preview 2

5. Preview PDF documents

Support PDF document preview, just like Word document, there are two preview modes

Image preview mode The preview effect is as follows

PDF Document preview 1

PDF Preview mode The preview effect is as follows

PDF Document Preview 2

6. Excel document preview

Supports the preview of XLS and XLSX documents. The preview effect is as follows

Excel Document Preview

7. Preview compressed files

Supports zip, RAR, JAR,tar, and gzip packages. The preview results are as follows

Preview compressed files 1

Click the file name in the compressed package to preview the file. The preview effect is as follows

Preview compressed files 2

8. Preview multimedia files

In theory, all video and audio files are supported. Because you cannot enumerate all file formats, the following types are enabled by default

mp3,wav,mp4,flv

A preview of the video looks like this

Multimedia file preview 1

The audio preview looks like this

Multimedia file Preview 2

9. CAD document preview

Support CAD DWG document preview, and word document, there are two preview modes

Image preview mode The preview effect is as follows

Cad document Preview 1

PDF Preview mode The preview effect is as follows

Cad Document Preview 2

For reasons of length, I will not paste the preview effect of other formats. If you are interested, you can refer to the example below

use

Project Use Technology

  • spring boot

  • freemarker

  • redisson

  • jodconverter

Depend on external environment

  • Redis (optional, not used by default)

  • OpenOffice or LibreOffice(built-in on Windows, automatically installed in Linux script startup mode, manually installed on Mac OS)

  1. Step 1: Pull project github.com/kekingcn/fi…

  2. Step 2: Run the main method of ServerMain. After the service is started, visit http://localhost:8012/ and you will see the following interface, indicating that the service is started successfully

See here, give it a thumbs up!