Open crThiago opened 4 months ago
The method _putxobjects calculate the stream length:
1 - $stream = $this->_getrawstream($stream, $data['n']); 2 - $out .= ' /Length '.strlen($stream); 3 - $out .= ' >>'; 4 - $out .= ' stream'."\n".$stream."\n".'endstream'; // INCREMENTED MORE BYTES HERE 5 - $out .= "\n".'endobj'; 6 - $this->_out($out);
but on line 4 $out .= ' stream'."\n".$stream."\n".'endstream'; is incremented more bytes (\n) resulting in a wrong calculation
$out .= ' stream'."\n".$stream."\n".'endstream';
Sugestion
Move the break line from line 4 to line 1:
1 - $stream = "\n" . $this->_getrawstream($stream, $data['n']) . "\n"; 2 - $out .= ' /Length '.strlen($stream); 3 - $out .= ' >>'; 4 - $out .= ' stream' . $stream . 'endstream';
The method _putxobjects calculate the stream length:
but on line 4
$out .= ' stream'."\n".$stream."\n".'endstream';
is incremented more bytes (\n) resulting in a wrong calculationSugestion
Move the break line from line 4 to line 1: