summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorPaweł Słomka <ppawelslomka@gmail.com>2017-12-02 20:28:43 +0100
committerKurt Jung <kurt.w.jung@gmail.com>2017-12-02 14:28:43 -0500
commit1bef4f81c40b64d68788e590003f4f8fbdc4d296 (patch)
treecd8bcc45c097cae05bdc15628fe0d95af69ca665 /fpdf.go
parenta3f28ba717a677e133f159e3fc1d42b249c2b511 (diff)
Add consts for page orientations (#150)
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdf.go b/fpdf.go
index 1503a4e..567311d 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -59,7 +59,9 @@ func (b *fmtBuffer) printf(fmtStr string, args ...interface{}) {
func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType) (f *Fpdf) {
f = new(Fpdf)
if orientationStr == "" {
- orientationStr = "P"
+ orientationStr = "p"
+ } else {
+ orientationStr = strings.ToLower(orientationStr)
}
if unitStr == "" {
unitStr = "mm"
@@ -143,7 +145,6 @@ func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType)
}
f.curPageSize = f.defPageSize
// Page orientation
- orientationStr = strings.ToLower(orientationStr)
switch orientationStr {
case "p", "portrait":
f.defOrientation = "P"