Giter VIP home page Giter VIP logo

libreoffice-server's Introduction

LiberOffice Server

js-standard-style action license GitHub last commit GitHub commit activity

基于 koa-starter 构建的 LibeOffice Server 转换服务。

目录

必要条件

  • 使用包管理器 (Linux) 或 msi (Windows) 在 /Applications (Mac) 中安装 libreoffice。

结构

├── .vscode                                // vscode 配置
├── app.js                                 // app入口文件
├── common                                 // 公共库
├── config                                 // 应用配置
├── deploy                                 // 部署示例
├── controller                             // 路由控制器
├── index.js                               // 启动文件
├── lib                                    // 工具库
├── logs                                   // 日志文件夹
├── middleware                             // 中间件
├── test                                   // 测试覆盖
├── models                                 // db model
├── public                                 // 静态资源文件夹
├── router                                 // 路由
├── schema                                 // 验证规则
├── service                                // 应用业务
└── views                                  // 模板

运行

  1. config下,创建 config-[name].js 配置文件;
  2. 安装项目依赖,启动项目。
npm ci

## 开发启动
npm run watch

## 生产启动
npm start

## 测试覆盖
npm run cov

用例

CURL

# 上传word转换为pdf
curl --request PUT \
  --url 'http://localhost:2058/soffice/word2pdf?prefix=w2022' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@/Users/potato/Desktop/sample.docx'

# 通过word url链接转换PDF,并返回文件流
curl --request GET \
  --url 'http://localhost:2058/soffice/preview?url=http://localhost:8038/upload/document/w2022/20220922/3dd78142-5250-486f-b66b-f4ad64e9f4a7.docx'

接口

已经实现的接口,已梳理为接口文档,托管在APIPOST,在线查看

部署

参考

赞赏

赞赏

Author

twitter/funnyzak Join the chat at https://gitter.im/libreoffice-server/community

| funnyzak

License

MIT License © 2022 funnyzak

libreoffice-server's People

Contributors

funnyzak avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

image2021

libreoffice-server's Issues

运行的时候报错

运行的时候报这个错误,是什么原因呢?
D:\work\code\officeServer\node_modules\rimraf\rimraf.js:310
throw er
^

Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\3248\AppData\Local\Temp\libreofficeConvert_-15744-PZdz1QfxtMfu'
at Object.rmdirSync (fs.js:916:10)
at rmkidsSync (D:\work\code\officeServer\node_modules\rimraf\rimraf.js:349:27)
at rmdirSync (D:\work\code\officeServer\node_modules\rimraf\rimraf.js:329:7)
at rimrafSync (D:\work\code\officeServer\node_modules\rimraf\rimraf.js:301:9)
at Object.cleanupCallback [as removeCallback] (D:\work\code\officeServer\node_modules\tmp\lib\tmp.js:356:16)
at D:\work\code\officeServer\node_modules\libreoffice-convert\index.js:63:17
at wrapper (D:\work\code\officeServer\node_modules\async\dist\async.js:271:20)
at D:\work\code\officeServer\node_modules\async\dist\async.js:1143:21
at D:\work\code\officeServer\node_modules\async\dist\async.js:327:20
at D:\work\code\officeServer\node_modules\libreoffice-convert\index.js:39:32
at D:\work\code\officeServer\node_modules\async\dist\async.js:2965:13
at wrapper (D:\work\code\officeServer\node_modules\async\dist\async.js:271:20)
at iteratorCallback (D:\work\code\officeServer\node_modules\async\dist\async.js:501:17)
at D:\work\code\officeServer\node_modules\async\dist\async.js:327:20
at D:\work\code\officeServer\node_modules\async\dist\async.js:2957:17
at D:\work\code\officeServer\node_modules\libreoffice-convert\index.js:36:68 {
errno: -4051,
syscall: 'rmdir',
code: 'ENOTEMPTY',
path: 'C:\Users\zzb\AppData\Local\Temp\libreofficeConvert
-15744-PZdz1QfxtMfu'
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.