C# Класс NSoft.NFramework.FusionCharts.PDFCompress

This is an ad-hoc class to compress PDF stream. Currently this class compresses binary (byte) stream using RLE which PDF 1.3 specification has thus formulated: The RunLengthDecode filter decodes data that has been encoded in a simple byte-oriented format based on run length. The encoded data is a sequence of runs, where each run consists of a length byte followed by 1 to 128 bytes of data. If the length byte is in the range 0 to 127, the following length + 1 (1 to 128) bytes are copied literally during decompression. If length is in the range 129 to 255, the following single byte is to be copied 257 − length (2 to 128) times during decompression. A length value of 128 denotes EOD. The chart image compression ratio comes to around 10:3
Показать файл Открыть проект

Открытые методы

Метод Описание
PDFCompress ( byte UnCompressed ) : System.IO

Takes the uncompressed byte array

RLECompress ( ) : byte[]

compresses uncompressed data to compressed data in byte array

Приватные методы

Метод Описание
WriteNoRepeater ( MemoryStream NoRepeatBytes ) : void
WriteRunLength ( int length, byte encodee ) : int

Write compressed data as RunLength

Описание методов

PDFCompress() публичный Метод

Takes the uncompressed byte array
public PDFCompress ( byte UnCompressed ) : System.IO
UnCompressed byte uncompressed data
Результат System.IO

RLECompress() публичный Метод

compresses uncompressed data to compressed data in byte array
public RLECompress ( ) : byte[]
Результат byte[]