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();
|
WordToPdf();
|
||||||
|
|
||||||
function WordToPdf();
|
function WordToPdf();
|
||||||
begin
|
begin
|
||||||
alias := "";
|
alias := "";
|
||||||
doc := "D:\\temp\\fangan.docx";
|
doc := "D:\\temp\\wordtopdf\\3M.docx";
|
||||||
output := "D:\\temp\\1.pdf";
|
// doc := "D:\\temp\\test1.docx";
|
||||||
// doc := "/mnt/d/temp/fontsize.docx";
|
// doc := "D:\\temp\\nihao.docx";
|
||||||
// output := "/mnt/d/temp/1.pdf";
|
// doc := "D:\\temp\\wordtopdf\\3M1.docx";
|
||||||
docx_to_pdf := new TSDocxToPdf(alias, doc);
|
output := "D:\\temp\\1.pdf";
|
||||||
docx_to_pdf.Font.UseBuiltInFont();
|
|
||||||
docx_to_pdf.Font.SetSubstitutionRules("仿宋", "宋体");
|
|
||||||
|
|
||||||
docx_to_pdf.Transform();
|
sysparams["_PDF_PAGE_GRID_DEBUG_"] := 0;
|
||||||
err := docx_to_pdf.SaveToFile(alias, output);
|
sysparams["_PDF_TEXT_DEBUG_"] := 0;
|
||||||
echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output, "\n";
|
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;
|
end;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue