2021-04-02 18:23:05 +02:00
|
|
|
#!/bin/bash
|
2021-04-17 18:23:19 +02:00
|
|
|
# This script receives three params
|
2021-04-02 18:23:05 +02:00
|
|
|
# Param 1: Input office file path (e.g. "/tmp/test.odt")
|
|
|
|
# Param 2: Output pdf file path (e.g. "/tmp/test.pdf")
|
2021-04-17 18:23:19 +02:00
|
|
|
# Param 3: Destination Format (pdf default)
|
|
|
|
#If output format is missing, define PDF
|
|
|
|
convertTo="${3:-pdf}"
|
2021-04-02 18:23:05 +02:00
|
|
|
|
2021-04-17 18:23:19 +02:00
|
|
|
curl -v -X POST "http://jodconverter:8080/lool/convert-to/$convertTo" \
|
2021-04-02 18:23:05 +02:00
|
|
|
-H "accept: application/octet-stream" \
|
|
|
|
-H "Content-Type: multipart/form-data" \
|
|
|
|
-F "data=@$1" > $2
|
|
|
|
|
|
|
|
exit 0
|