From 8bbcd8145eff74b951fde4a1277eb6f60a018998 Mon Sep 17 00:00:00 2001 From: em Date: Sun, 29 Jan 2023 22:54:19 +0100 Subject: [PATCH] add docs --- README.md | 29 +++++++++++++++++++++-------- examples/example.docx | Bin 0 -> 4263 bytes 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 examples/example.docx diff --git a/README.md b/README.md index c83492e..9059068 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,19 @@ This project is basically an extended version of [jodconverter-samples-rest](htt You can use this project as it is using docker with `ghcr.io/eugenmayer/kontextwork-converter` or build it here yourself. + +## Usage + +```bash +docker run --memory 512m --name converter-prod --rm -p 8080:8080 ghcr.io/eugenmayer/kontextwork-converter:production +``` + +Now convert a `docx` to `html` +```bash +cd officeconverter +curl -F file=@examples/example.docx "localhost:14080/conversion?format=html" -o /tmp/test.html +``` + ## Build local java build, when you have all the build tools present + libreoffice locally installed @@ -18,13 +31,11 @@ local java build, when you have all the build tools present + libreoffice locall or better use the docker image with everything included, no dev tools/LO needed locally - # this builds the source a - make build - - make start-prod - - # alternativly - docker run --memory 512m --name converter-prod --rm -p 8080:8080 ghcr.io/eugenmayer/kontextwork-converter:production +```bash +# this builds the source a +make build +make start-prod +``` You can now connect to the 5001 remote debugger port, just use the existing IntelliJ task if you like @@ -69,6 +80,8 @@ debugging port enabled on 5001 ## REST endpoints Check the controller to understand the different endpoints + +- `/conversion?format=html` as multipart with `file` as the file to convert and `format` for the target format ## Release @@ -105,7 +118,7 @@ server: You can edit the [src/resources/document-formats.json](src/resources/document-formats.json) and add new custom formats. The original can be found at (https://github.com/jodconverter/jodconverter/blob/master/jodconverter-core/src/main/resources/document-formats.json)[jodconverter-core]. -We already added support for dotx/xltx for example. +We already added support for `dotx/xltx` for example. ## Internals diff --git a/examples/example.docx b/examples/example.docx new file mode 100644 index 0000000000000000000000000000000000000000..2cdb5f353a511dc9e2eda6183de81a8d724924ab GIT binary patch literal 4263 zcmaJ^2{hDg`^FeM*=dj^McKD9W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