mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-10-17 17:53:17 +01:00
feat(pdfengines): optimize PDF images to reduce file size (#359)
This commit is contained in:
@@ -281,6 +281,12 @@ type PdfEngine interface {
|
||||
// PdfFormats. If no format, it does nothing.
|
||||
Convert(ctx context.Context, logger *slog.Logger, formats PdfFormats, inputPath, outputPath string) error
|
||||
|
||||
// OptimizeImages re-encodes the raster images of a PDF in place to shrink
|
||||
// the file, leaving text, vectors, fonts and structure untouched.
|
||||
// imageQuality is the JPEG quality (1 to 100) applied to each re-encoded
|
||||
// image.
|
||||
OptimizeImages(ctx context.Context, logger *slog.Logger, imageQuality int, inputPath string) error
|
||||
|
||||
// ReadMetadata extracts the metadata of a given PDF file.
|
||||
ReadMetadata(ctx context.Context, logger *slog.Logger, inputPath string) (map[string]any, error)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user