public function compress()
{
if ($this->stream != '' && function_exists('gzcompress') && strpos($this->def, ' /Image') === false && strpos($this->def, '/FlateDecode') === false) {
$this->compress = true;
$this->stream = "\n" . gzcompress($this->stream, 9) . "\n";
$this->isCompressed = true;
}
}
public function testCompress() { $o = new Object("<<5 0 obj\nstream\nBlah Blah\nendstreamendobj\n>>"); $o->compress(); $this->assertContains('<</Length 16 /Filter /FlateDecode>>', (string) $o); $this->assertTrue($o->isCompressed()); }