feat(pdfengines): add PDF/UA (#714)

This commit is contained in:
Julien Neuhart
2023-11-05 20:14:36 +01:00
committed by GitHub
parent 9c3dfc78df
commit 143b7ce678
39 changed files with 1300 additions and 1013 deletions

View File

@@ -47,17 +47,17 @@ type Options struct {
Landscape bool
// PageRanges allows to select the pages to convert.
// TODO: should prefer a method form PDFEngine.
// TODO: should prefer a method form PdfEngine.
// Optional.
PageRanges string
// PdfFormat allows to convert the resulting PDF to PDF/A-1a, PDF/A-2b, or
// PDF/A-3b.
// PdfFormats allows to convert the resulting PDF to PDF/A-1a, PDF/A-2b,
// PDF/A-3b and PDF/UA.
// Optional.
PdfFormat string
PdfFormats gotenberg.PdfFormats
}
// Uno is an abstraction on top of Api.
// Uno is an abstraction on top of the Universal Network Objects API.
type Uno interface {
Pdf(ctx context.Context, logger *zap.Logger, inputPath, outputPath string, options Options) error
Extensions() []string
@@ -265,13 +265,13 @@ func (a *Api) Metrics() ([]gotenberg.Metric, error) {
func (a *Api) Checks() ([]health.CheckerOption, error) {
return []health.CheckerOption{
health.WithCheck(health.Check{
Name: "api",
Name: "libreoffice",
Check: func(_ context.Context) error {
if a.supervisor.Healthy() {
return nil
}
return errors.New("LibreOffice unhealthy")
return errors.New("LibreOffice is unhealthy")
},
}),
}, nil