Package com.itextpdf.pdfoptimizer
Class OptimizationSession
java.lang.Object
com.itextpdf.pdfoptimizer.OptimizationSession
Class is used to handle auxiliary activities during the optimization processing (i. e. generating optimization report).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOptimizationSession
(DefaultReportBuilder reportBuilder) Creates an instance of OptimizationSession with providedDefaultReportBuilder
. -
Method Summary
Modifier and TypeMethodDescriptiongetStoredValue
(String key) Retrieves stored value associated with the provided key.void
registerEvent
(SeverityLevel level, String message, Object... args) Registers an event of optimization process.void
storeValue
(String key, Object value) Puts a value and a key associated with it into internal storage.
-
Field Details
-
WRITER_PROPERTIES_KEY
- See Also:
-
RESOURCES_FOR_CONVERSION_KEY
- See Also:
-
CONVERTED_CONTENT_STREAMS_KEY
- See Also:
-
RESOURCES_FOR_STREAM_PROCESSING_KEY
- See Also:
-
PROCESSED_CONTENT_STREAMS_KEY
- See Also:
-
ANY_ERRORS_OCCURRED_KEY
- See Also:
-
CURRENT_RESOURCES_KEY
- See Also:
-
IS_PDF_A_DOCUMENT_KEY
- See Also:
-
CANVAS_PROCESSOR_KEY
- See Also:
-
EVENT_LISTENER_KEY
- See Also:
-
-
Constructor Details
-
OptimizationSession
Creates an instance of OptimizationSession with providedDefaultReportBuilder
.- Parameters:
-
reportBuilder
- is a report builder
-
-
Method Details
-
registerEvent
Registers an event of optimization process.- Parameters:
-
level
- is a severity level of the event -
message
- is a text message of the event -
args
- are arguments of the message if it is parametrized
-
getStoredValue
Retrieves stored value associated with the provided key.- Parameters:
-
key
- is a key to access the value - Returns:
- the value associated with the key
-
storeValue
Puts a value and a key associated with it into internal storage.- Parameters:
-
key
- is a key to access the value -
value
- is a value associated with the key
-