diff --git a/lib/Cpdf.php b/lib/Cpdf.php index fbd2bcec1..3d068ddfe 100644 --- a/lib/Cpdf.php +++ b/lib/Cpdf.php @@ -1142,24 +1142,9 @@ protected function o_fontDescendentCID($id, $action, $options = '') // we need a CID system info section $cidSystemInfoId = ++$this->numObj; - $this->o_contents($cidSystemInfoId, 'new', 'raw'); + $this->o_cidSystemInfo($cidSystemInfoId, 'new'); $this->objects[$id]['info']['cidSystemInfo'] = $cidSystemInfoId; - $ordering = '(UCS)'; - $registry = '(Adobe)'; - - if ($this->encrypted) { - $this->encryptInit($id); - $ordering = $this->ARC4($ordering); - $registry = $this->ARC4($registry); - } - - $res = '<objects[$cidSystemInfoId]['c'] = $res; - // and a CID to GID map $cidToGidMapId = ++$this->numObj; $this->o_fontGIDtoCIDMap($cidToGidMapId, 'new', $options); @@ -1228,6 +1213,42 @@ protected function o_fontDescendentCID($id, $action, $options = '') return null; } + protected function o_cidSystemInfo($id, $action, $options = '') + { + switch ($action) { + case 'new': + $this->objects[$id] = array( + 't' => 'cidSystemInfo' + ); + break; + case 'add': + break; + case 'out': + $ordering = '(UCS)'; + $registry = '(Adobe)'; + + if ($this->encrypted) { + $this->encryptInit($id); + $ordering = $this->ARC4($ordering); + $registry = $this->ARC4($registry); + } + + + $res = "\n$id 0 obj\n"; + + $res .= '<