code: func (f *Fpdf) UseTemplateScaled(t Template, corner PointType, size SizeType) {
  	if t == nil {
  		f.SetErrorf("template is nil")
  		return
  	}
  
  	// You have to add at least a page first
  	if f.page <= 0 {
  		f.SetErrorf("cannot use a template without first adding a page")
  		return
  	}
  
  	// make a note of the fact that we actually use this template, as well as any other templates,
  	// images or fonts it uses
  	f.templates[t.ID()] = t
  	for _, tt := range t.Templates() {
  		f.templates[tt.ID()] = tt
  	}
  	for name, ti := range t.Images() {
  		name = sprintf("t%s-%s", t.ID(), name)
  		f.images[name] = ti
  	}
  
  	// template data
  	_, templateSize := t.Size()
  	scaleX := size.Wd / templateSize.Wd
  	scaleY := size.Ht / templateSize.Ht
  	tx := corner.X * f.k
  	ty := (f.curPageSize.Ht - corner.Y - size.Ht) * f.k
  
  	f.outf("q %.4f 0 0 %.4f %.4f %.4f cm", scaleX, scaleY, tx, ty) // Translate
  	f.outf("/TPL%s Do Q", t.ID())
  }
docs: // UseTemplateScaled adds a template to the current page or another template,
  // using the given page coordinates.