code: func newTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, fn func(*Tpl), copyFrom *Fpdf) Template {
  	sizeStr := ""
  
  	fpdf := fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, size)
  	tpl := Tpl{*fpdf}
  	if copyFrom != nil {
  		tpl.loadParamsFromFpdf(copyFrom)
  	}
  	tpl.Fpdf.AddPage()
  	fn(&tpl)
  
  	bytes := make([][]byte, len(tpl.Fpdf.pages))
  	// skip the first page as it will always be empty
  	for x := 1; x < len(bytes); x++ {
  		bytes[x] = tpl.Fpdf.pages[x].Bytes()
  	}
  
  	templates := make([]Template, 0, len(tpl.Fpdf.templates))
  	for _, key := range templateKeyList(tpl.Fpdf.templates, true) {
  		templates = append(templates, tpl.Fpdf.templates[key])
  	}
  	images := tpl.Fpdf.images
  
  	template := FpdfTpl{corner, size, bytes, images, templates, tpl.Fpdf.page}
  	return &template
  }
docs: /*
   * Copyright (c) 2015 Kurt Jung (Gmail: kurt.w.jung),
   *   Marcus Downing, Jan Slabon (Setasign)
   *
   * Permission to use, copy, modify, and distribute this software for any
   * purpose with or without fee is hereby granted, provided that the above
   * copyright notice and this permission notice appear in all copies.
   *
   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  // newTpl creates a template, copying graphics settings from a template if one is given