Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EC-Nordbund/gotenberg
A gotenberg client for Deno
https://github.com/EC-Nordbund/gotenberg
deno docx2pdf gotenberg office2pdf topdf xlsx2pdf
Last synced: 29 days ago
JSON representation
A gotenberg client for Deno
- Host: GitHub
- URL: https://github.com/EC-Nordbund/gotenberg
- Owner: EC-Nordbund
- License: gpl-3.0
- Created: 2022-01-27T15:48:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T02:22:20.000Z (12 months ago)
- Last Synced: 2024-10-16T20:05:05.602Z (about 2 months ago)
- Topics: deno, docx2pdf, gotenberg, office2pdf, topdf, xlsx2pdf
- Language: TypeScript
- Homepage: https://doc.deno.land/https://deno.land/x/gotenberg/mod.ts
- Size: 47.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gotenberg - Deno - EC-Nordbund/gotenberg
README
# Gotenberg Deno Client
## API
We have 4 types of exported functions:
1. File-Loader helper (`readFile`)
2. `RequestInfo` creator (`office`, `merge`, `convert`, `url`, `markdown`,
`url`)
3. Executoren (`executor`, `webhookExecutor`)
4. Response handler (`handleZipResponse`, `handleResponse`)To create a request:
1. create a (global) execcutor wich can be used for multiple requests (we
provide 2 one with webhook options). You might use multiple executoren in
your project!
2. create the RequestInfo object by calling the corresponding function depending
on your use case.
3. pass the RequestInfo to the executor it returns a `Promise`.
4. pass the Promise (or the Response) to one of the response handler. If you
expect more than one pdf file use `handleZipResponse`. If you expect a single
PDF use `handleResponse`## Basic example:
```ts
import {
executor,
handleResponse,
office,
readFile,
} from "https://deno.land/x/gotenberg/mod.ts";const gotenberg = executor("http://gotenberg:3000");
const { filename, content } = await handleResponse(
gotenberg(
office([await readFile("./path/to/file.docx")], {
landscape: true,
}),
),
);
```## API Documentation
The generated API documentaion you can find here:
https://doc.deno.land/https://deno.land/x/gotenberg/mod.ts