PdfCompressor class

Main public API for compressing PDF files.

Example:

final result = await PdfCompressor.compressPdf(
  '/path/to/input.pdf',
  level: CompressionLevel.medium,
);

print('Original: ${result.originalSizeMB} MB');
print('Compressed: ${result.compressedSizeMB} MB');
print('Saved at: ${result.compressedPath}');

Constructors

PdfCompressor.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

compressPdf(String sourcePath, {CompressionLevel level = CompressionLevel.medium}) Future<CompressResult>
Compress the PDF at sourcePath with the given level.