This commit is contained in:
Klaus Wendel, archium GmbH 2021-03-03 09:35:38 +01:00
parent 8ebf9d1b9d
commit 40d96e32b9

View File

@ -39,18 +39,18 @@ func (f *Fpdf) CreateTemplateCustom(corner PointType, size SizeType, fn func(*Tp
// landscape mode. This causes problems when placing the template in a master
// document where this condition does not apply. CreateTpl() is a similar
// function that lets you specify the orientation to avoid this problem.
func CreateTemplate(corner PointType, size SizeType, unitStr, fontDirStr string, fn func(*Tpl)) Template {
func CreateTemplate(corner PointType, size SizeType, unitStr, fontDirStr string, density float64, fn func(*Tpl)) Template {
orientationStr := "p"
if size.Wd > size.Ht {
orientationStr = "l"
}
return CreateTpl(corner, size, orientationStr, unitStr, fontDirStr, fn)
return CreateTpl(corner, size, orientationStr, unitStr, fontDirStr, density, fn)
}
// CreateTpl creates a template not attached to any document
func CreateTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string,f.density, fn func(*Tpl)) Template {
return newTpl(corner, size, orientationStr, unitStr, fontDirStr, fn, nil)
func CreateTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, density float64, fn func(*Tpl)) Template {
return newTpl(corner, size, orientationStr, unitStr, fontDirStr, density, fn, nil)
}
// UseTemplate adds a template to the current page or another template,