Package com.itextpdf.kernel.pdf
Class ASCII85CompressionStrategy
java.lang.Object
com.itextpdf.kernel.pdf.ASCII85CompressionStrategy
- All Implemented Interfaces:
-
IStreamCompressionStrategy
A compression strategy that uses the
ASCII85Decode filter for PDF streams.
This strategy implements the IStreamCompressionStrategy interface and provides ASCII85Decode encoding.
The strategy ensures, that streams are saved using just 7-bit ASCII characters, but it typically increases sizes of streams by 25% compared to just saving them as-is. So calling this a "compression strategy" is a misnomer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNewOutputStream(OutputStream original, PdfStream stream) Creates a new output stream with ASCII85 compression applied.Returns the decode parameters for theASCII85Decodefilter.Returns the name of the compression filter.
-
Constructor Details
-
ASCII85CompressionStrategy
public ASCII85CompressionStrategy()Constructs a newASCII85CompressionStrategyinstance.
-
-
Method Details
-
getFilterName
Returns the name of the compression filter.- Specified by:
-
getFilterNamein interfaceIStreamCompressionStrategy - Returns:
-
PdfName.ASCII85Decoderepresenting theASCII85Decodefilter
-
getDecodeParams
Returns the decode parameters for theASCII85Decodefilter.This implementation returns
nullas no special decode parameters are required for standard ASCII85 compression.- Specified by:
-
getDecodeParamsin interfaceIStreamCompressionStrategy - Returns:
-
nullas no decode parameters are needed
-
createNewOutputStream
Creates a new output stream with ASCII85 compression applied.This method wraps the original output stream in a
ASCII85OutputStreamthat applies ASCII85 compression.- Specified by:
-
createNewOutputStreamin interfaceIStreamCompressionStrategy - Parameters:
-
original- the original output stream to wrap -
stream- the PDF stream containing compression configuration - Returns:
-
a new
ASCII85OutputStreamthat compresses data using the ASCII85 algorithm
-