mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-12-06 16:22:15 +00:00
feat(pdf): add compressStreams to optimize
This commit is contained in:
@@ -475,6 +475,10 @@ func (s *optimizeStage) compaction(packObjectStreams bool) []litho.WriteOption {
|
||||
opts = append(opts, litho.WithImageRecompression())
|
||||
}
|
||||
|
||||
if boolOr(s.CompressStreams, true) {
|
||||
opts = append(opts, litho.WithStreamCompression())
|
||||
}
|
||||
|
||||
if boolOr(s.SubsetFonts, true) {
|
||||
opts = append(opts, litho.WithFontSubsetting())
|
||||
}
|
||||
|
||||
@@ -735,6 +735,7 @@ type optimizeStage struct {
|
||||
ObjectStreams *bool `json:"objectStreams"`
|
||||
Dedup *bool `json:"dedup"`
|
||||
RecompressImages *bool `json:"recompressImages"`
|
||||
CompressStreams *bool `json:"compressStreams"`
|
||||
SubsetFonts *bool `json:"subsetFonts"`
|
||||
|
||||
signatureDrop
|
||||
|
||||
@@ -18,6 +18,7 @@ Feature: /forms/pdf/optimize
|
||||
When I make a "POST" request to Gotenberg at the "/forms/pdf/optimize" endpoint with the following form data and header(s):
|
||||
| files | testdata/pages_12.pdf | file |
|
||||
| recompressImages | false | field |
|
||||
| compressStreams | false | field |
|
||||
| subsetFonts | false | field |
|
||||
Then the response status code should be 200
|
||||
Then the "pages_12.pdf" PDF should have 12 page(s)
|
||||
|
||||
Reference in New Issue
Block a user