Package com.itextpdf.kernel.pdf
Class ASCIIHexCompressionStrategy
java.lang.Object
com.itextpdf.kernel.pdf.ASCIIHexCompressionStrategy
- All Implemented Interfaces:
-
IStreamCompressionStrategy
A compression strategy that uses the
ASCIIHexDecode filter for PDF streams.
This strategy implements the IStreamCompressionStrategy interface and provides ASCIIHexDecode encoding.
The strategy ensures, that streams are saved using just 7-bit ASCII characters, but it doubles the sizes of streams 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 ASCIIHex compression applied.Returns the decode parameters for theASCIIHexDecodefilter.Returns the name of the compression filter.
-
Constructor Details
-
ASCIIHexCompressionStrategy
public ASCIIHexCompressionStrategy()Constructs a newASCIIHexCompressionStrategyinstance.
-
-
Method Details
-
getFilterName
Returns the name of the compression filter.- Specified by:
-
getFilterNamein interfaceIStreamCompressionStrategy - Returns:
-
PdfName.ASCIIHexDecoderepresenting theASCIIHexDecodefilter
-
getDecodeParams
Returns the decode parameters for theASCIIHexDecodefilter.This implementation returns
nullas no special decode parameters are required for standard ASCIIHex compression.- Specified by:
-
getDecodeParamsin interfaceIStreamCompressionStrategy - Returns:
-
nullas no decode parameters are needed
-
createNewOutputStream
Creates a new output stream with ASCIIHex compression applied.This method wraps the original output stream in a
ASCIIHexOutputStreamthat applies ASCIIHex compression.- Specified by:
-
createNewOutputStreamin interfaceIStreamCompressionStrategy - Parameters:
-
original- the original output stream to wrap -
stream- the PDF stream containing compression configuration - Returns:
-
a new
ASCIIHexOutputStreamthat compresses data using the ASCIIHex algorithm
-