nochmal dasselbe
This commit is contained in:
parent
1022ea11e9
commit
041ba85cc6
23
fpdf.go
23
fpdf.go
|
@ -67,6 +67,7 @@ func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType)
|
||||||
if unitStr == "" {
|
if unitStr == "" {
|
||||||
unitStr = "mm"
|
unitStr = "mm"
|
||||||
}
|
}
|
||||||
|
|
||||||
if sizeStr == "" {
|
if sizeStr == "" {
|
||||||
sizeStr = "A4"
|
sizeStr = "A4"
|
||||||
}
|
}
|
||||||
|
@ -3482,7 +3483,29 @@ func (f *Fpdf) getpagesizestr(sizeStr string) (size SizeType) {
|
||||||
sizeStr = strings.ToLower(sizeStr)
|
sizeStr = strings.ToLower(sizeStr)
|
||||||
// dbg("Size [%s]", sizeStr)
|
// dbg("Size [%s]", sizeStr)
|
||||||
var ok bool
|
var ok bool
|
||||||
|
|
||||||
|
//20210302 archium addendum begin
|
||||||
|
//enable custom page formats
|
||||||
|
if strings.Contains(sizeStr, "x") {
|
||||||
|
var (
|
||||||
|
aString []string
|
||||||
|
aFloat []float64
|
||||||
|
aErr error
|
||||||
|
)
|
||||||
|
aString = strings.Split(sizeStr, "x")
|
||||||
|
for i := 0; i <= 1; i++ {
|
||||||
|
aFloat[i], aErr = strconv.ParseFloat(aString[i], 64)
|
||||||
|
if aErr != nil {
|
||||||
|
f.err = fmt.Errorf("unknown page size %s", sizeStr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size, ok = SizeType{aFloat[0], aFloat[1]}, true
|
||||||
|
} else {
|
||||||
|
//20210302 archium addendum end
|
||||||
size, ok = f.stdPageSizes[sizeStr]
|
size, ok = f.stdPageSizes[sizeStr]
|
||||||
|
//20210302 archium addendum begin
|
||||||
|
}
|
||||||
|
//20210302 archium addendum end
|
||||||
if ok {
|
if ok {
|
||||||
// dbg("found %s", sizeStr)
|
// dbg("found %s", sizeStr)
|
||||||
size.Wd /= f.k
|
size.Wd /= f.k
|
||||||
|
|
Loading…
Reference in New Issue
Block a user