feat(ExifTool): add capability to overwrite metadata of the PDF generated (#776)

* add new metadata functions to pdf engine interface

* add exiftool module with relevant test cases

* use exiftool to overwrite metadata in libreoffice

* use exiftool to overwrite metadata in chromium

* fix linter issues

* fix more linter issues

* more test cases for better coverage

* remove utils

* minor changes

* remove metadata from pdfoptions

* correct indentation

* read/write metadata one file at a time.
This commit is contained in:
Piyush Srivastava
2024-02-16 18:46:50 +00:00
committed by Julien Neuhart
parent 31e7582216
commit 71911cb1a7
24 changed files with 1433 additions and 39 deletions

View File

@@ -64,6 +64,12 @@ type PdfEngine interface {
// Convert transforms a given PDF to the specified formats defined in
// PdfFormats. If no format, it does nothing.
Convert(ctx context.Context, logger *zap.Logger, formats PdfFormats, inputPath, outputPath string) error
// ReadMetadata extracts the metadata of a given PDF file and load them into the provided metadata object.
ReadMetadata(ctx context.Context, logger *zap.Logger, inputPath string, metadata map[string]interface{}) error
// WriteMetadata writes the metadata into a given PDF file.
WriteMetadata(ctx context.Context, logger *zap.Logger, inputPath string, newMetadata map[string]interface{}) error
}
// PdfEngineProvider offers an interface to instantiate a [PdfEngine].