feat(pdfengines): add flatten form field to split route

This commit is contained in:
Julien Neuhart
2025-01-28 17:15:14 +01:00
parent b418f1eb05
commit 1d1b4fb04d
6 changed files with 102 additions and 22 deletions

View File

@@ -3,6 +3,7 @@
//
// 1. The merging of PDF files.
// 2. The splitting of PDF files.
// 3. Flattening of PDF files
//
// The path to the QPDF binary must be specified using the QPDK_BIN_PATH
// environment variable.

View File

@@ -101,7 +101,8 @@ func (engine *QPdf) Merge(ctx context.Context, logger *zap.Logger, inputPaths []
return fmt.Errorf("merge PDFs with QPDF: %w", err)
}
// Flatten merges annotation appearances with page content, deleting the original annotations.
// Flatten merges annotation appearances with page content, deleting the
// original annotations.
func (engine *QPdf) Flatten(ctx context.Context, logger *zap.Logger, inputPath string) error {
var args []string
args = append(args, "--generate-appearances")