diff --git a/library/Zend/Pdf/Resource/Font/Simple.php b/library/Zend/Pdf/Resource/Font/Simple.php index 63a5258115..a7ae546950 100644 --- a/library/Zend/Pdf/Resource/Font/Simple.php +++ b/library/Zend/Pdf/Resource/Font/Simple.php @@ -173,6 +173,10 @@ public function glyphNumberForCharacter($characterCode) */ public function getCoveredPercentage($string, $charEncoding = '') { + if ($string === null || $string === '') { + return 0; + } + /* Convert the string to UTF-16BE encoding so we can match the string's * character codes to those found in the cmap. */ @@ -261,6 +265,10 @@ public function widthForGlyph($glyphNumber) */ public function encodeString($string, $charEncoding) { + if ($string === null || $string === '') { + return ''; + } + if (PHP_OS == 'AIX') { return $string; // returning here b/c AIX doesnt know what CP1252 is } @@ -279,6 +287,10 @@ public function encodeString($string, $charEncoding) */ public function decodeString($string, $charEncoding) { + if ($string === null || $string === '') { + return ''; + } + return iconv('CP1252', $charEncoding, $string); } }