diff --git a/pkg/gotenberg/pdfengine.go b/pkg/gotenberg/pdfengine.go index a59efccf..f8eaad6e 100644 --- a/pkg/gotenberg/pdfengine.go +++ b/pkg/gotenberg/pdfengine.go @@ -96,8 +96,9 @@ type PdfEngine interface { // Split splits a given PDF file. Split(ctx context.Context, logger *zap.Logger, mode SplitMode, inputPath, outputDirPath string) ([]string, error) - // Flatten PDF refers to merging the annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document - // By flattening and merging existing annotation appearances with page content, the original annotations are deleted from the PDF pages. + // Flatten merges existing annotation appearances with page content, effectively deleting the original annotations. + // This process can flatten forms as well, as forms share a relationship with annotations. + // Note that this operation is irreversible. Flatten(ctx context.Context, logger *zap.Logger, inputPath, outputPath string) error // Convert transforms a given PDF to the specified formats defined in diff --git a/pkg/modules/qpdf/qpdf.go b/pkg/modules/qpdf/qpdf.go index 5b9bf5fd..82a9700d 100644 --- a/pkg/modules/qpdf/qpdf.go +++ b/pkg/modules/qpdf/qpdf.go @@ -101,7 +101,7 @@ func (engine *QPdf) Merge(ctx context.Context, logger *zap.Logger, inputPaths [] return fmt.Errorf("merge PDFs with QPDF: %w", err) } -// Flatten is not available in this implementation. +// Flatten merges annotation appearances with page content, deleting the original annotations. func (engine *QPdf) Flatten(ctx context.Context, logger *zap.Logger, inputPath, outputPath string) error { var args []string args = append(args, "--generate-appearances")