function setGeneratorType(new_type) {
      privateData.length = 0
      var is_ok = false

      if (new_type) {
        for (var cur_type in officegenGlobals.types) {
          if (
            cur_type === new_type &&
            officegenGlobals.types[cur_type] &&
            officegenGlobals.types[cur_type].createFunc
          ) {
            officegenGlobals.types[cur_type].createFunc(
              genobj,
              new_type,
              genobj.options,
              privateData,
              officegenGlobals.types[cur_type]
            )
            is_ok = true
            break
          } // Endif.
        } // End of for loop.

        if (!is_ok) {
          // console.error ( '\nFATAL ERROR: Either unknown or unsupported file type - %s\n', options.type )
          genobj.emit('error', 'FATAL ERROR: Invalid file type.')
        } // Endif.
      } // Endif.
    }
Configure this object to generate the given type of document.
<br /><br />

Called by the document constructor to configure the new document object to the given type.

@param {string} new_type The type of document to create.