优化页眉的显示

This commit is contained in:
Minho
2018-01-30 13:48:07 +08:00
parent 5f13063346
commit e927e0372b
5 changed files with 16 additions and 7 deletions

View File

@@ -476,12 +476,12 @@ func (this *Converter) convertToPdf() (err error) {
//header template
if len(this.Config.Header) > 0 {
args = append(args, "--pdf-header-template", this.Config.Header)
args = append(args, "--pdf-header-template", GetFooterOrHeaderParams(this.Config.Header))
}
//footer template
if len(this.Config.Footer) > 0 {
args = append(args, "--pdf-footer-template", this.Config.Footer)
args = append(args, "--pdf-footer-template",GetFooterOrHeaderParams(this.Config.Footer))
}
if len(this.Config.MarginLeft) > 0 {

View File

@@ -45,3 +45,7 @@ func parseConfig(configFile string) (cfg Config, err error) {
}
return
}
func GetFooterOrHeaderParams(v string) string {
return v
}

5
converter/util_linux.go Normal file
View File

@@ -0,0 +1,5 @@
package converter
func GetFooterOrHeaderParams(v string) string {
return "\"" + v +"\""
}