文件无法使用openbts打开

时间:2019-06-12 10:39:15

标签: symfony4 opentbs tinybutstrong

我在Symfony 4应用程序中使用opentbs下载odt文件。 下载已完成,但文件未打开,我不知道如何开始解决此问题以及它的来源

这是我的控制器

/**
     * @param Project $project
     * @param OpenTBS $TBS
     * @return string|BinaryFileResponse
     * @ParamConverter("analyse", options={"mapping": {"id"   : "id"}})
     * @SWG\Parameter(name="id", in="path", type="integer", description="Supplier Id"))
     * @SWG\Response(response=200, description="Return listScoreAnalyses")
     *
     * @Rest\Get("rapports/{id}/rapport")
     */
    public function getRapportAction(Project $project, OpenTBS $TBS)
    {

        // load your template
        $template = '/home/ke/Documents/test.odt';
        $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
        // remplace les variables
        $TBS -> MergeField ( 'client' , array ( 'name' => 'Ford Prefect' ));
        // envoie le fichier

        $TBS -> Show ( OPENTBS_DOWNLOAD , 'rapport.odt' );
        dump($TBS);

这就是问题

enter image description here

这是我的模型test.odt

... some text in a word file with a `[client.name]` variable ...

我需要帮助

0 个答案:

没有答案