PaperForge.Compression (PaperForge v0.2.0)

Copy Markdown View Source

Compression helpers used by PDF streams.

PDF content streams commonly use the /FlateDecode filter, which corresponds to zlib-compatible DEFLATE compression.

Summary

Functions

Compresses binary or iodata using zlib.

Decompresses data previously compressed with flate/1.

Functions

flate(data)

@spec flate(iodata()) :: binary()

Compresses binary or iodata using zlib.

Example

compressed =
  PaperForge.Compression.flate(
    "BT /F1 12 Tf ET"
  )

inflate(data)

@spec inflate(binary()) :: binary()

Decompresses data previously compressed with flate/1.

This function is mainly useful for tests and debugging.