From e5636a2afa597a568da765b92e16400fc1d7cb75 Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Wed, 12 Dec 2018 16:34:34 +0100 Subject: [PATCH] adding .txt and .rtf files support (#20) --- README.md | 2 +- build/docs/04-office.md | 2 + docs/index.html | 2 + internal/app/api/office.go | 2 + internal/pkg/printer/office_test.go | 2 + test/testdata/office/document.rtf | 2196 +++++++++++++++++++++++++++ test/testdata/office/document.txt | 3 + 7 files changed, 2208 insertions(+), 1 deletion(-) create mode 100644 test/testdata/office/document.rtf create mode 100644 test/testdata/office/document.txt diff --git a/README.md b/README.md index 1f182576..65c5a621 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ At TheCodingMachine, we build a lot of web applications (intranets, extranets an ## Features * HTML and Markdown conversions using Google Chrome headless -* Office conversions (.docx, .doc, .odt, .pptx, .ppt, .odp and so on) using [unoconv](https://github.com/dagwieers/unoconv) +* Office conversions (.txt, .rtf, .docx, .doc, .odt, .pptx, .ppt, .odp and so on) using [unoconv](https://github.com/dagwieers/unoconv) * Performance :zap:: Google Chrome and Libreoffice (unoconv) started once in the background thanks to PM2 * Failure prevention :broken_heart:: PM2 automatically restarts previous processes if they fail * Assets :package:: send your header, footer, images, fonts, stylesheets and so on for converting your HTML and Markdown to beaufitul PDFs! diff --git a/build/docs/04-office.md b/build/docs/04-office.md index 6c9567cc..bb8fd1f9 100644 --- a/build/docs/04-office.md +++ b/build/docs/04-office.md @@ -10,6 +10,8 @@ It accepts `POST` requests with a `multipart/form-data` Content-Type. You may send one or more Office documents. Following file extensions are accepted: +* `.txt` +* `.rtf` * `.doc` * `.docx` * `.odt` diff --git a/docs/index.html b/docs/index.html index 23fbea6d..5a54a96a 100755 --- a/docs/index.html +++ b/docs/index.html @@ -557,6 +557,8 @@ in the file index.html. This function will convert a given markdown

You may send one or more Office documents. Following file extensions are accepted: