function MakeHeadfootPlugin(pluginsman) {
  var funcThis = this

  // You can change it if you want to support more types, since that the Word and Excel document generators also supporting very similar plugins:
  if (pluginsman.docType !== 'docx') {
    throw new Error(
      '[docx-headfoot] This plugin supporting only Word based documents.'
    )
  } // Endif.

  this.ogPluginsApi = pluginsman.ogPluginsApi // Generic officegen API for plugins.
  this.msPluginsApi = pluginsman.genPrivate.plugs.type.msoffice // msoffice plugins API.
  this.pluginsman = pluginsman // Document type specific plugins API.

  this.docxData = pluginsman.getDataStorage() // Here you can store any temporary data needed for generating the document and depending on the data filled by the user.

  this.mainPath = pluginsman.genPrivate.features.type.msoffice.main_path // The "folder" name inside the document zip that all the specific resources of this document type are stored.
  this.mainPathFile =
    pluginsman.genPrivate.features.type.msoffice.main_path_file // The name of the main real xml resource of this document.
  this.relsMain = pluginsman.genPrivate.type.msoffice.rels_main // Main rels file.
  this.relsApp = pluginsman.genPrivate.type.msoffice.rels_app // Main rels file inside the specific document type "folder".
  this.filesList = pluginsman.genPrivate.type.msoffice.files_list // Resources list xml.
  this.srcFilesList = pluginsman.genPrivate.type.msoffice.src_files_list // For storing extra files inside the document zip.

  //
  // Catch events inside the document so we can extent it:
  //

  // We want to extend the main API of the docx document object:
  pluginsman.registerCallback('makeDocApi', function (docObj) {
    funcThis.extenddocxApi(docObj)
  })

  // This event tell us that the generator is about to start working:
  pluginsman.registerCallback('beforeGen', function (docObj) {
    funcThis.beforeGen(docObj)
  })

  return this
}
This function creating the docx header-footer plugin object.
@summary Create a new docx plugin.
@param {object} pluginsman Access to the plugins manager for docx documents.
@constructor
@name MakeHeadfootPlugin