Forum


Replies: 10   Views: 4128
Utf8 support
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by js  · 11-04-2013 - 12:13

Hi,

sorry didn't had the time to test that until now. I was not able to get that working. Which font would you recommend to use? The default font for my test document was Arial or Calibri using Office 2010 on a win 7 (x64) PC.

Furthermore, I am now also facing charset issues in another function. The template is a plain vanilla word document which just contains the var $ITEMS$ ([url]http://www.security-blog.eu/wp-content/uploads/2013/01/LOR_TEST.docx[/url]). This document is called from the following function:
[code]
public function GenerateLoR_mytest() {
$style_base = "font-family:Arial; word-break: break-all; border-width:1px; border-color:black; border-style:solid; border-collapse:collapse; ";

$docx = new CreateDocx();
$docx->addTemplate('template_files/LOR_TEST.docx');
$items = "<table width=\"100%\" style=\"".$style_base."\">";
$items .= "<tr>";
$items .= "<td style=\"".$style_base."width:44pt; background-color: #CCCCCC; font-size:9pt;\">ÄÖÜäöü</td>";
$items .= "</tr>";
$items .= "</table>";
$docx->replaceTemplateVariableByHTML('ITEMS', 'block', $items, array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false));

$path = $this->NewPath();
$docx_name = $GLOBALS['t']->t("DOCX_LOR_PATH_PREFIX").date('Ymd')." ".$GLOBALS['t']->t("DOCX_LOR_PATH_SUFIX");
$paramsDocument = array(
'orient' => 'landscape'
);
$docx->createDocx($path['full_path'].$docx_name, $paramsDocument);

return $path['download_path'].$docx_name.".docx";

}
[/code]

The german umlauts (ÄÖÜäöü) are again not displayed as they should. See resulting document: [url]http://www.security-blog.eu/wp-content/uploads/2013/01/LOR_TEST.docx[/url] PHPDOCX v3.0 Pro is already installed.