\r
$imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h150-' . $this->pages[1]['document_page'] . '.jpg');\r
$this->pdf2htmlRatio = $imagesize[0] / $this->layouts[1]['width'];\r
- $this->scale = 5;\r
+ $this->scale = 10;\r
$this->multiply = $this->pdf2htmlRatio * $this->scale;\r
\r
$this->createHTML();\r
if (!is_null($group['y'])) {\r
$class[] = 'y' . $group['y'];\r
}\r
+ if (!is_null($group['letterspacing'])) {\r
+ $class[] = 'l' . $group['letterspacing'];\r
+ }\r
+ if (!is_null($group['wordspacing'])) {\r
+ $class[] = 'w' . $group['wordspacing'];\r
+ }\r
$class = implode(' ', $class);\r
\r
$res = '<div class="' . $class . '">';\r
if (!is_null($span['x'])) {\r
$class[] = 'x' . $span['x'];\r
}\r
- if (!is_null($span['letterspacing'])) {\r
- $class[] = 'l' . $span['letterspacing'];\r
- }\r
\r
if (count($class)) {\r
$class = ' class="' . implode(' ', $class) . '"';\r
}\r
\r
foreach ($this->cssLetterSpacing as $letterspacing => $index) {\r
- $letterspacing*=$this->multiply;\r
- $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'px}';\r
+ $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'em}';\r
}\r
\r
foreach ($this->cssWordSpacing as $wordspacing => $index) {\r
- $wordspacing*=$this->multiply;\r
- $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'px}';\r
+ $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'em}';\r
}\r
\r
foreach ($this->cssX as $x => $index) {\r
'color' => $this->getCSSColor($group['color']),\r
'size' => $this->getCSSSize($group['size']),\r
'font' => $this->getCSSFont($group['font'], $document_id),\r
+ 'letterspacing' => $this->getCSSLetterSpacing($group['letterspacing']),\r
+ 'wordspacing' => $this->getCSSWordSpacing($group['wordspacing']),\r
'y' => ($group['size']) / -1.2,\r
'spans' => $res);\r
}\r
}\r
return array('text' => $text,\r
'x' => $this->normalizeFloatValue($span['x']),\r
- 'width' => $this->normalizeFloatValue($span['width']),\r
- 'letterspacing' => null);\r
+ 'width' => $this->normalizeFloatValue($span['width']));\r
}\r
\r
protected function getCSSSize(&$size) {\r
- $size/=1.05;\r
+ $size=$this->normalizeFloatValue($size, 1);\r
$sizer = round($size * $this->multiply);\r
return $this->getIndex($sizer, $this->cssSize);\r
}\r
}\r
\r
protected function getCSSLetterSpacing($letterspacing) {\r
+\r
$letterspacing = $this->normalizeFloatValue($letterspacing, 5);\r
+\r
if ($letterspacing == 0) {\r
return null;\r
}\r
\r
protected function getCSSWordSpacing($wordspacing) {\r
$wordspacing = $this->normalizeFloatValue($wordspacing, 5);\r
+\r
if ($wordspacing == 0) {\r
return null;\r
}\r