code: func (f *Fpdf) OutputFileAndClose(fileStr string) error {
  	if f.err == nil {
  		pdfFile, err := os.Create(fileStr)
  		if err == nil {
  			f.Output(pdfFile)
  			pdfFile.Close()
  		} else {
  			f.err = err
  		}
  	}
  	return f.err
  }
docs: // OutputFileAndClose creates or truncates the file specified by fileStr and
  // writes the PDF document to it. This method will close f and the newly
  // written file, even if an error is detected and no document is produced.
  //
  // Most examples demonstrate the use of this method.