@ -11,6 +11,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
"runtime"
|
||||||
// "github.com/leanote/leanote/app/types"
|
// "github.com/leanote/leanote/app/types"
|
||||||
// "io/ioutil"
|
// "io/ioutil"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -463,6 +464,9 @@ func (c Note) ExportPdf(noteId string) revel.Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("/bin/sh", "-c", cc)
|
cmd := exec.Command("/bin/sh", "-c", cc)
|
||||||
|
if runtime.GOARCH == "windows" {
|
||||||
|
cmd = exec.Command("cmd", "/C", cc)
|
||||||
|
}
|
||||||
_, err := cmd.Output()
|
_, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.RenderText("export pdf error. " + fmt.Sprintf("%v", err))
|
return c.RenderText("export pdf error. " + fmt.Sprintf("%v", err))
|
||||||
|
Reference in New Issue
Block a user