All Projects → awesome-fc → fc-libreoffice

awesome-fc / fc-libreoffice

Licence: MIT license
84 MB LibreOffice to fit inside Aliyun Function Compute compressed with Brotli

Programming Languages

shell
77523 projects
javascript
184084 projects - #8 most used programming language
Smarty
1635 projects
Makefile
30231 projects

Projects that are alternatives of or similar to fc-libreoffice

Papirus Libreoffice Theme
Papirus theme for LibreOffice
Stars: ✭ 140 (+438.46%)
Mutual labels:  libreoffice
barcode
LibreOffice Barcode Extension
Stars: ✭ 25 (-3.85%)
Mutual labels:  libreoffice
alfresco-share-online-edition-addon
Online edition with Libreoffice in Alfresco Share
Stars: ✭ 15 (-42.31%)
Mutual labels:  libreoffice
Xlsxir
Xlsx parser for the Elixir language.
Stars: ✭ 167 (+542.31%)
Mutual labels:  libreoffice
Libreoffice Impress Templates
Freely-licensed LibreOffice Impress templates
Stars: ✭ 238 (+815.38%)
Mutual labels:  libreoffice
LOC-Extension
LibreOffice Cryptocurrency extension
Stars: ✭ 33 (+26.92%)
Mutual labels:  libreoffice
Etherpad Lite
Etherpad: A modern really-real-time collaborative document editor.
Stars: ✭ 11,937 (+45811.54%)
Mutual labels:  libreoffice
convert-document
A docker container for LibreOffice and unoconv, used to generate PDF files from office-type documents.
Stars: ✭ 53 (+103.85%)
Mutual labels:  libreoffice
noa-libre
UNO API of LibreOffice easy and understandable - Nice Office Access
Stars: ✭ 31 (+19.23%)
Mutual labels:  libreoffice
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (+61.54%)
Mutual labels:  libreoffice
Richdocuments
📔 Collabora Online for Nextcloud
Stars: ✭ 193 (+642.31%)
Mutual labels:  libreoffice
Docsbox
Self-hosted document converting service with HTTP API
Stars: ✭ 235 (+803.85%)
Mutual labels:  libreoffice
LibbieOffice
My attempt at a LibreOffice image replacement script
Stars: ✭ 39 (+50%)
Mutual labels:  libreoffice
Aws Lambda Libreoffice
85 MB LibreOffice to fit inside AWS Lambda compressed with Brotli
Stars: ✭ 145 (+457.69%)
Mutual labels:  libreoffice
utools-recent-projects
uTools 插件, 快速查询最近打开的项目
Stars: ✭ 84 (+223.08%)
Mutual labels:  libreoffice
Spreadsheet server
A python server harnessing the calculational ability of LibreOffice Calc (thanks to 'pyoo'). It provides 'instant' access to the cell ranges of a set of spreadsheets.
Stars: ✭ 132 (+407.69%)
Mutual labels:  libreoffice
WollMux
Letterhead, template, form, autotext, mail merge,... extension for LibreOffice
Stars: ✭ 45 (+73.08%)
Mutual labels:  libreoffice
carbone
Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
Stars: ✭ 810 (+3015.38%)
Mutual labels:  libreoffice
designing-with-libreoffice
The work to translate Designing with LibreOffice book into traditional Chinese.
Stars: ✭ 17 (-34.62%)
Mutual labels:  libreoffice
loeclipse
LibreOffice Eclipse plugin for extension development
Stars: ✭ 26 (+0%)
Mutual labels:  libreoffice

fc-libreoffice

注意: 下面借助于 OSS 解压的方法已经不推荐,仅供学习而保留,对于大文件和依赖目前更推荐 NAS 方案,希望快速上手请移步 https://github.com/vangie/libreoffice-example

fc-libreoffice 是一个开箱即用的 word 转 pdf NPM 包。

fc-docker 提供的 runtime-nodejs8 环境下编译,并且进行了精简,采用了压缩比最高的 Brotli 工具进行打包,最终压缩包大小为 84 M。这个大小仍然超过了 FC 50M 的代码包限制,所以采用 OSS 运行时下载并解压的方式制作了 example 工程。example 工程提供了方便的 Makefile 脚本,集成了 fun ,简单配置后可以快捷部署。

安装

npm install awesome-fc/fc-libreoffice#master --save

使用

const { convertFileToPDF } = require('fc-libreoffice');

module.exports.handler = (event, context, callback) => {
    convertFileToPDF('/tmp/example.docx', binPath)
        .then(() => {
            console.log('convert success.');
            callback(null, 'done');
        })
        .catch((e) => {
            console.log('convert success.');
            callback(e, 'fail')
        });

};

快速体验

# 克隆项目
git clone https://github.com/awesome-fc/fc-libreoffice.git

# 进入示例工程目录
cd fc-libreoffice/example

# 配置 .env 文件
cp env.example .env

# 部署函数
make deploy

# 调用函数
make invoke

# 从 OSS 下载 PDF 到当前目录,查看转换后的结果
make download

编译 libreoffice

bin 目录下已经放置了一个在 fc 环境下编译好的 lo.tar.br 打包文件,所以正常情况下不需要编译。

找一台 linux 机器,mac 下编译会有问题。预先安装好 docker 即可。

cd compile/
./build.sh

最终会生成 lo.tar.br 文件。

参考阅读

  1. https://github.com/shelfio/aws-lambda-libreoffice
  2. https://github.com/vladgolubev/serverless-libreoffice
  3. https://github.com/shelfio/aws-lambda-brotli-unpacker
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].