Forum


Replies: 4   Views: 3449
Blank document in windows/centos/debian linix environments
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 vami_kri  · 22-07-2013 - 13:31

Dear all



I'm getting blank document while trying to create a simple hello world example



Envionment:



Windows - PHP 5.3.1/tidy/zip/XSLT enabled



Debion Linux - PHP 5.3.8 /zip/XSLT enabled



Centos Linux - PHP 5.4.1 /Zip/XSLT enabled



Used Code:



require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$text = array();

$text[] =

    array(

    'text' => 'I am going to write'

    );

$text[] =

    array(

    'text' => ' Hello World!',

    'b' => 'on'

    );

 

$text[] =

    array(

    'text' => ' using bold characters.'

    );

$docx->addText($text);

$docx->createDocx('tmp/hello_world_2');



Log:



2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Create a temp file to use as initial ZIP file. DOCX is a ZIP file.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Set language.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Add text to word document.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Set DOCX name to: tmp/hello_world_2.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  DOCX is a new file, not a template.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Remove existing template tags.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Add word/document.xml content to DOCX file.

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Close ZIP file

2013-07-22T16:54:31+05:30 phpdocx_logger INFO  Copy DOCX file using a new name.



File get created but with no content.



Please advices


Posted by vami_kri  · 22-07-2013 - 14:01

I'm Getting this error in all the places where ever i used array!!



Warning: htmlspecialchars() expects parameter 1 to be string, array given in D:\www\xampp\htdocs\phpdocx\classes\CreateElement.inc on line 880


Posted by admin-phpdocx  · 22-07-2013 - 15:31

That is bizarre because the createText should not call to that method in the PRO versions.



Are you using the COMMUNITY version? In that case addText does not support arrays...


Posted by vami_kri  · 22-07-2013 - 15:38

[quote=admin-phpdocx]



That is bizarre because the createText should not call to that method in the PRO versions.



Are you using the COMMUNITY version? In that case addText does not support arrays...



[/quote]



Yes Community version only. Experimenting with few things. Thanks for letting us know. But it is good to have this comment on tutorial as "Please use only PRO" version for trying out these examples.



Thanks