Task for optimizing the PDF document.
For a list of optimization methods this task can perform have a look at the ::call method.
Public Class Methods
Optimizes the PDF document.
The field entries that are optional and set to their default value are always deleted. Additional optimization methods are performed depending on the values of the following arguments:
Compacts the object space by merging the revisions and then deleting null and unused values if set to
Specifies if and how object streams should be used: For :preserve, existing object streams are preserved; for :generate objects are packed into object streams as much as possible; and for :delete existing object streams are deleted.
Specifies if cross-reference streams should be used. Can be :preserve (no modifications), :generate (use cross-reference streams) or :delete (remove cross-reference streams).
object_streamsis set to :generate, this option is implicitly changed to :generate.
Compresses the content streams of all pages if set to
true. Note that this can take a very long time because each content stream has to be unfiltered, parsed, serialized and then filtered again.
Compacts the document by merging all revisions into one, deleting null and unused entries and renumbering the objects.
For the meaning of the other arguments see ::call.
Compresses the contents of all pages by parsing and then serializing again. The HexaPDF serializer is already optimized for small output size so nothing else needs to be done.
Deletes field entries of the object that are optional and currently set to their default value.
Processes the object streams in each revision according to method: For :preserve, nothing is done, for :delete all object streams are deleted and for :generate objects are packed into object streams as much as possible.
Processes the cross-reference streams in each revision according to method: For :preserve, nothing is done, for :delete all cross-reference streams are deleted and for :generate cross-reference streams are added.