mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-22 20:23:35 +08:00
修改Linux下生成pdf的BUG
This commit is contained in:
@@ -610,7 +610,7 @@ func (c *DocumentController) Export() {
|
|||||||
|
|
||||||
RecursiveFun(0, "", dpath, c, book, docs, pathList)
|
RecursiveFun(0, "", dpath, c, book, docs, pathList)
|
||||||
|
|
||||||
defer os.RemoveAll(dpath)
|
//defer os.RemoveAll(dpath)
|
||||||
|
|
||||||
os.MkdirAll("./cache", 0766)
|
os.MkdirAll("./cache", 0766)
|
||||||
pdfpath := "cache/" + identify + ".pdf"
|
pdfpath := "cache/" + identify + ".pdf"
|
||||||
|
6
docs/wkhtmltopdf.md
Normal file
6
docs/wkhtmltopdf.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## wkhtmltopdf 安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt-get install -y libxrender-dev
|
||||||
|
apt-get install -y libxext-dev
|
||||||
|
```
|
@@ -19,7 +19,7 @@ func ConverterHtmlToPdf(uri []string,path string) (error) {
|
|||||||
if exe == "" {
|
if exe == "" {
|
||||||
return errors.New("wkhtmltopdf not exist.")
|
return errors.New("wkhtmltopdf not exist.")
|
||||||
}
|
}
|
||||||
params := []string{"/C",exe,"--margin-bottom","25"}
|
params := []string{"-c",exe,"--margin-bottom","25"}
|
||||||
|
|
||||||
params = append(params,uri...)
|
params = append(params,uri...)
|
||||||
params = append(params,path)
|
params = append(params,path)
|
||||||
|
Reference in New Issue
Block a user