php - ckediter文本如何在word文件中转换?它没有打开任何人都可以帮助我吗?
问题描述
我在 Laravel 中做了一个块我在 textarea 中使用 ckeditor 并使用 Laravel 以 word 格式下载该文本文件,但它没有打开并给出错误 XML 解析错误
我下载word文件
$data= Templete::where('id',$id)->first();
$wordTest= new \PhpOffice\PhpWord\PhpWord();
$newSection= $wordTest->addSection();
$wordText = $data['word'];
$newSection->addText($wordText);
$objectWriter = \PhpOffice\PhpWord\IOFactory::createWriter($wordTest,'Word2007');
try
{
$objectWriter->save(storage_path('TestWordFile.docx'));
}
catch(Exception $e) {
}
return response()->download(storage_path('TestWordFile.docx'));
// Templete::where('id',$id)->delete();
session()->flash('message','file download ');
return redirect()->to('/text');
我想用我下载的word打开文件
解决方案
推荐阅读
- asp.net - ASP.NET/VB.NET 错误消息说“'#ButtonName#' 未声明。由于它的保护级别,它可能无法访问。”
- c++ - 具有不同返回类型的 C++ 函数
- webpack - 如何在 sass 和 vue js 中使用 resolve-url-loader
- scala - Scala同时循环2个序列
- xml - 如何使用 vb.net 在 XML 中保存和读取特殊目录路径?
- windows - 批处理文件变量不打印
- kubernetes - 服务未在 Kubernetes 中公开
- docker - 启动时由 docker 绑定的端口,但不是正在运行的容器
- sql - Netezza 中的 REVERSE 功能不起作用,如果没有它,如何从路径中提取文件名?
- javascript - Angular 6 中延迟加载的功能可以使用 ngrx 在功能之间通信状态吗?