php - 将 RTL 文档转换为 PDF
问题描述
有没有办法从 RTL doc/docx 文件中读取并转换为具有相同样式的 PDF 格式?我的代码的结果只是我的文档的一部分,没有图像和页眉和页脚部分。
// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord = \PhpOffice\PhpWord\IOFactory::load('doc2.docx');
$lang = new \PhpOffice\PhpWord\Style\Language();
$lang->setLangId(1065);
$phpWord->getSettings()->setThemeFontLang($lang);
// Adding Text element with font customized using explicitly created font style
$fontStyle = new \PhpOffice\PhpWord\Style\Font();
$fontStyle->setBold(true);
$fontStyle->setRTL(true);
$fontStyle->setName('B nazanin');
$fontStyle->setSize(13);
$phpWord->addFontStyle('*', $fontStyle);
// I plan to get PDF version after converting HTML
// but it does not read all content from the word file
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$objWriter->save('doc.html');
解决方案
推荐阅读
- c# - .NET 应用程序缓存旧图标
- macos - lldb 调试java 进程。跳过 EXC_BAD_ACCESS
- ios - 如何在 Alamofire 中将原始数据作为参数发布?
- python - 在Python中将数组数组转换为json
- python - 用python中的griddata插入二维3D数据
- angular - Angular CLI 1.6.7“ng build”因错误而失败,但在 Jenkins 中没有退出
- asp.net - 向 localhost 发出许多 Web 请求时,HttpClient 在 GetAsync 上挂起
- java - Spring boot 2.0.5.RELEASE 应用程序不在 JBoss 6.4.0 中部署
- c++ - 到达 Pe 文件中的 .text 部分
- mysql - 用子查询排序奇怪