func (this *Importer) PutFormXobjects() map[string]int {
	res := make(map[string]int, 0)
	tplNamesIds, err := this.GetWriter().PutFormXobjects(this.GetReader())
	if err != nil {
		panic(err)
	}
	for tplName, pdfObjId := range tplNamesIds {
		res[tplName] = pdfObjId.id
	}
	return res
}
Put form xobjects and get back a map of template names (e.g. /GOFPDITPL1) and their object ids (int)
package gofpdi
import (
	"fmt"
	"io"
)
type Importer struct {
	sourceFile    string
	readers       map[string]*PdfReader
	writers       map[string]*PdfWriter
	tplMap        map[int]*TplInfo
	tplN          int
	writer        *PdfWriter
	importedPages map[string]int
}
type TplInfo struct {
	SourceFile string
	Writer     *PdfWriter
	TemplateId int
}
func (this *Importer) GetReader() *PdfReader {
	return this.GetReaderForFile(this.sourceFile)
}
func (this *Importer) GetWriter() *PdfWriter {
	return this.GetWriterForFile(this.sourceFile)
}
func (this *Importer) GetReaderForFile(file string) *PdfReader {
	if _, ok := this.readers[file]; ok {
		return this.readers[file]
	}
	return nil
}
func (this *Importer) GetWriterForFile(file string) *PdfWriter {
	if _, ok := this.writers[file]; ok {
		return this.writers[file]
	}
	return nil
}
func NewImporter() *Importer {
	importer := &Importer{}
	importer.init()
	return importer
}
func (this *Importer) init() {
	this.readers = make(map[string]*PdfReader, 0)
	this.writers = make(map[string]*PdfWriter, 0)
	this.tplMap = make(map[int]*TplInfo, 0)
	this.writer, _ = NewPdfWriter("")
	this.importedPages = make(map[string]int, 0)
}
func (this *Importer) SetSourceFile(f string) {
	this.sourceFile = f
	if _, ok := this.readers[this.sourceFile]; !ok {
		reader, err := NewPdfReader(this.sourceFile)
		if err != nil {
			panic(err)
		}
		this.readers[this.sourceFile] = reader
	}
	if _, ok := this.writers[this.sourceFile]; !ok {
		writer, err := NewPdfWriter("")
		if err != nil {
			panic(err)
		}
		writer.SetTplIdOffset(this.tplN)
		this.writers[this.sourceFile] = writer
	}
}
func (this *Importer) SetSourceStream(rs *io.ReadSeeker) {
	this.sourceFile = fmt.Sprintf("%v", rs)
	if _, ok := this.readers[this.sourceFile]; !ok {
		reader, err := NewPdfReaderFromStream(*rs)
		if err != nil {
			panic(err)
		}
		this.readers[this.sourceFile] = reader
	}
	if _, ok := this.writers[this.sourceFile]; !ok {
		writer, err := NewPdfWriter("")
		if err != nil {
			panic(err)
		}
		writer.SetTplIdOffset(this.tplN)
		this.writers[this.sourceFile] = writer
	}
}
func (this *Importer) GetNumPages() int {
	result, err := this.GetReader().getNumPages()
	if err != nil {
		panic(err)
	}
	return result
}
func (this *Importer) GetPageSizes() map[int]map[string]map[string]float64 {
	result, err := this.GetReader().getAllPageBoxes(1.0)
	if err != nil {
		panic(err)
	}
	return result
}
func (this *Importer) ImportPage(pageno int, box string) int {
	pageNameNumber := fmt.Sprintf("%s-%04d", this.sourceFile, pageno)
	if _, ok := this.importedPages[pageNameNumber]; ok {
		return this.importedPages[pageNameNumber]
	}
	res, err := this.GetWriter().ImportPage(this.GetReader(), pageno, box)
	if err != nil {
		panic(err)
	}
	tplN := this.tplN
	this.tplMap[tplN] = &TplInfo{SourceFile: this.sourceFile, TemplateId: res, Writer: this.GetWriter()}
	this.tplN++
	this.importedPages[pageNameNumber] = tplN
	return tplN
}
func (this *Importer) SetNextObjectID(objId int) {
	this.GetWriter().SetNextObjectID(objId)
}