mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-13 10:52:15 +01:00
docs: improve godoc and documentation [skip ci]
This commit is contained in:
@@ -1,14 +1,32 @@
|
||||
# Adding PDF Engine Features
|
||||
|
||||
When adding a new PDF engine capability (e.g., bookmarks, watermark, stamp, embed), you must update the Makefile to include the corresponding engine list variable and flag. Every `--pdfengines-*-engines` flag registered in `pkg/modules/pdfengines/pdfengines.go` must have a matching entry in the Makefile:
|
||||
Each new PDF engine capability (e.g., bookmarks, watermark, stamp, embed) requires a matching Makefile entry. The Makefile variables control which engines are passed to Gotenberg at `make run` and `make test-integration` time (via `compose.yaml`). If you skip this step, the flag still works when set manually, but `make run` falls back to the default defined in `pdfengines.go`, which may not include the new engine.
|
||||
|
||||
1. **Add a variable** in the Makefile's variable block (around line 60-70):
|
||||
Every `--pdfengines-*-engines` flag registered in `pkg/modules/pdfengines/pdfengines.go` must have a corresponding variable and flag in the Makefile:
|
||||
|
||||
1. **Add a variable** in the Makefile's variable block (around line 60 to 70):
|
||||
```makefile
|
||||
PDFENGINES_<FEATURE>_ENGINES=<default engines>
|
||||
```
|
||||
2. **Add the flag** in the Makefile's command args block (around line 140-155):
|
||||
```makefile
|
||||
--pdfengines-<feature>-engines=$(PDFENGINES_<FEATURE>_ENGINES) \
|
||||
2. **Add the flag** in `compose.yaml`'s command args:
|
||||
```yaml
|
||||
- "--pdfengines-<feature>-engines=${PDFENGINES_<FEATURE>_ENGINES}"
|
||||
```
|
||||
|
||||
The default value should match what is defined in `pdfengines.go`'s `fs.StringSlice(...)` call for that flag.
|
||||
The default value must match the `fs.StringSlice(...)` call for that flag in `pdfengines.go`.
|
||||
|
||||
## Example: Rotate
|
||||
|
||||
The rotate feature was added with two engines (`pdfcpu` and `pdftk`). Here is what the additions look like:
|
||||
|
||||
**Makefile** (variable block):
|
||||
|
||||
```makefile
|
||||
PDFENGINES_ROTATE_ENGINES=pdfcpu,pdftk
|
||||
```
|
||||
|
||||
**compose.yaml** (command args):
|
||||
|
||||
```yaml
|
||||
- "--pdfengines-rotate-engines=${PDFENGINES_ROTATE_ENGINES}"
|
||||
```
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Package pdfengines a way to gather and manage multiple modules that
|
||||
// implement the gotenberg.PdfEngine interface.
|
||||
// Package pdfengines gathers and manages modules that implement
|
||||
// gotenberg.PdfEngine.
|
||||
package pdfengines
|
||||
|
||||
Reference in New Issue
Block a user