// txt, code
go build
// txt, code, images, documents
go build -tags extralibs
- libreoffice
- libreofficekit-dev
- libvips
- libvips-dev
just use the provided Dockerfile
preview
Can be set through config.yml
port: 3201
key: any
uploadlimit: 33000000
text:
fontdpi: 72
fontsize: 12
fontfile: "./fonts/DroidSansMono.ttf"
or through ENV parameters ( APP_TEXT_FONTSIZE, etc.)
for all modes
- port - http port of the service, default is 3201
- key - secret key
- uploadlimit - max file size allowed
for code previews
- fontdpi - screen resolution in Dots Per Inch
- fontfile - filename of the ttf font
- fontsize - font size in points
Service expects POST request with a document and respond with preview image
POST http://localhost:3201/preview
form-multipart
- width - requested preview width, number in pixels
- height - requested preview height, number in pixels
- file - body of document for which preview need to be generated
Response is a png of jpg image of preview
If key
parameter was set in the configuration, the incoming request must contains matching URL parameter
POST https://some.com/preview?key={key}
- Documents ( doc, docx, xls, xlsx, pdf )
- Images ( jpg, png, tiff, svg, gif, webp )
- Code files ( js, json, css, html, yaml, yml, xml, ts, md, ini, java, go, sql, sh )
MIT