Project

General

Profile

Actions

Feature #8959

open

Microsoft Office Document in Browser Preview

Added by Terence Mill over 14 years ago. Updated about 21 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Resolution:

Description

It would be very usefull to have a office document preview, so being able to read word documents in document, files or attachment area.
This coiukld be done by using on the fly conversion which can be done by openoffice server. There is a simple an easy web service called Jodconverter for converting office to many other formats like pdf or html.


Files

Actions #1

Updated by Go MAEDA about 21 hours ago

I wrote a patch to add a simple preview for Microsoft Office documents (such as Word, Excel, and PowerPoint) on AttachmentsController#show page. The patch uses Microsoft's MarkItDown command to convert supported Office files into Markdown and renders that Markdown in Redmine. Because the preview is generated from Markdown, original layout is not preserved and non-text contents will be lost, but it enables quick content inspection without downloading the file.

This MS Office documents preview is available only when MarkItDown is installed. It is an optional dependency, so Redmine continues to work without it; only this preview feature is unavailable. To install MarkItDown, run: pip install 'markitdown[all]'.

When a user opens `AttachmentsController#show` page for a supported MS Office attachment, Redmine calls the `markitdown` command and converts the file to Markdown, which may take a few seconds. Redmine then renders the converted Markdown as the preview. Generated Markdown is cached in tmp/markdownized_previews, so subsequent accesses are much faster. Preview content is truncated to a fixed size limit of 100 KB. This caching approach follows the same pattern already used by thumbnails, which are generated via ImageMagick convert and stored in tmp/thumbnails.

Currently, for Microsoft Office attachments, Redmine does not show document content on the attachment page; users must download the file and open it locally to inspect it. This patch adds a practical inline preview that helps users quickly understand what the document contains and can reduce download/open steps in daily workflows.

Preview for a MS Word document:

Original MS Word document:

Actions

Also available in: Atom PDF