diff options
-rw-r--r-- | fpdf.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2800,8 +2800,8 @@ func (f *Fpdf) WriteLinkID(h float64, displayStr string, linkID int) { func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) { lMargin, _, rMargin, _ := f.GetMargins() + pageWidth, _ := f.GetPageSize() if width == 0 { - pageWidth, _ := f.GetPageSize() width = pageWidth - (lMargin + rMargin) } @@ -2829,7 +2829,9 @@ func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) f.Write(lineHeight, lineStr) f.SetLeftMargin(lMargin) default: + f.SetRightMargin(pageWidth - lMargin - width) f.Write(lineHeight, lineStr) + f.SetRightMargin(rMargin) } } } @@ -3252,12 +3254,14 @@ func (f *Fpdf) putImportedTemplates() { } } -// UseImportedTemplate uses imported template from gofpdi - draws imported PDF page onto page +// UseImportedTemplate uses imported template from gofpdi. It draws imported +// PDF page onto page. func (f *Fpdf) UseImportedTemplate(tplName string, scaleX float64, scaleY float64, tX float64, tY float64) { f.outf("q 0 J 1 w 0 j 0 G 0 g q %.4F 0 0 %.4F %.4F %.4F cm %s Do Q Q\n", scaleX*f.k, scaleY*f.k, tX*f.k, (tY+f.h)*f.k, tplName) } -// ImportTemplates imports gofpdi template names into importedTplObjs - to be included in the procset dictionary +// ImportTemplates imports gofpdi template names into importedTplObjs for +// inclusion in the procset dictionary func (f *Fpdf) ImportTemplates(tpls map[string]string) { for tplName, tplID := range tpls { f.importedTplObjs[tplName] = tplID |