update
This commit is contained in:
parent
20cfa5120a
commit
2cfa0ec4af
14
README.md
14
README.md
|
|
@ -1,3 +1,13 @@
|
|||
# WordToPdf
|
||||
# PdfConverter
|
||||
|
||||
word转pdf工具
|
||||
文件转 Pdf 工具
|
||||
|
||||
## 部署
|
||||
|
||||
将此文件夹部署到 tsl 安装目录下`funcext`即可
|
||||
|
||||
### 相关依赖
|
||||
|
||||
1. `office_plugin.dll`
|
||||
2. [PDF](https://git.mytsl.cn/tinysoft/Pdf)相关包
|
||||
3. [Office](https://git.mytsl.cn/tinysoft/Office)相关包
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
// NameSpace "DOCX";
|
||||
|
||||
WordToPdf();
|
||||
|
||||
function WordToPdf();
|
||||
begin
|
||||
alias := "";
|
||||
doc := "D:\\temp\\fangan.docx";
|
||||
output := "D:\\temp\\1.pdf";
|
||||
// doc := "/mnt/d/temp/fontsize.docx";
|
||||
// output := "/mnt/d/temp/1.pdf";
|
||||
docx_to_pdf := new TSDocxToPdf(alias, doc);
|
||||
docx_to_pdf.Font.UseBuiltInFont();
|
||||
docx_to_pdf.Font.SetSubstitutionRules("仿宋", "宋体");
|
||||
alias := "";
|
||||
doc := "D:\\temp\\wordtopdf\\3M.docx";
|
||||
// doc := "D:\\temp\\test1.docx";
|
||||
// doc := "D:\\temp\\nihao.docx";
|
||||
// doc := "D:\\temp\\wordtopdf\\3M1.docx";
|
||||
output := "D:\\temp\\1.pdf";
|
||||
|
||||
docx_to_pdf.Transform();
|
||||
err := docx_to_pdf.SaveToFile(alias, output);
|
||||
echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output, "\n";
|
||||
sysparams["_PDF_PAGE_GRID_DEBUG_"] := 0;
|
||||
sysparams["_PDF_TEXT_DEBUG_"] := 0;
|
||||
docx_to_pdf := new TSDocxToPdf(alias, doc);
|
||||
docx_to_pdf.Font.SetSubstitutionRules("仿宋", "宋体");
|
||||
docx_to_pdf.Transform();
|
||||
err := docx_to_pdf.SaveToFile(alias, output);
|
||||
echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output, "\n";
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue