TinyButStrong - the PHP Template Engine
Categories > OpenTBS with DOCX >

Docx Corrupt with Changepic

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Johnwolf
Date: 2017-01-04
Time: 21:01

Docx Corrupt with Changepic

Hi,

I'm using the OpenTbs Library (1.9.6) I'm trying to generate a docx file. Every thing works fin except with an image field

Here's my code :
Php :

       $mission[] = array(
            "logo"  => "/var/www/oscar/back/web/templates/c.png",
        );

        $TBS = $this->container->get('opentbs');
        $TBS->LoadTemplate('/var/www/back/web/templates/template-cv.docx',OPENTBS_ALREADY_UTF8);
        $TBS->MergeBlock('mission', $mission);
        $TBS->Show(OPENTBS_DOWNLOAD, 'file_name.docx');

in my template i'v put an image with a description :
[mission.logo;ope=changepic;default=current;tagpos=inside;adjust]

The docx file is generate corrupted, but word can repair it and the result is OK

Could you help me ?

Thanks

John
By: Skrol29
Date: 2017-01-09
Time: 10:43

Re: Docx Corrupt with Changepic

Hi,

The most common error is when extra content is sent by the PHP application that drives OpenTBS.
See http://www.tinybutstrong.com/opentbs.php?doc#debug_error