new makemsdoc(genobj, new_type, options, gen_private, type_info)
Extend officegen object with MS-Office support.
This method extending the given officegen object with the common code needed by any MS-Office based document.
Use this module for every type of MS-Office document.
| Name | Type | Description |
|---|---|---|
genobj |
object | The object to extend. |
new_type |
object | The type of object to create. |
options |
object | The object's options. |
gen_private |
object | Access to the internals of this object. |
type_info |
object | Additional information about this type. |
Example
Using this module for implementing a new MS-Office based document type:
var baseobj = require ( "officegen" );
var msdoc = require ( "./lib/msofficegen.js" );
function makeMyDoc ( officegenObj, typeCodeName, options, officegenObjPlugins, typeInfo ) {
msdoc.makemsdoc ( officegenObj, typeCodeName, options, officegenObjPlugins, typeInfo );
officegenObjPlugins.plugs.type.msoffice.makeOfficeGenerator ( 'word', 'document', {} );
officegenObj.on ( 'clearData', function () {
});
}
Methods
-
innercbMakeCore(data)
-
???.
Name Type Description dataobject Ignored by this callback function. Returns:
Text string. -
innercbMakeMainFilesList(data)
-
Create the main files list resource.
Name Type Description dataobject Ignored by this callback function. Returns:
Text string. -
innercbMakeTheme(data)
-
???.
Name Type Description dataobject Ignored by this callback function. Returns:
Text string. -
innercbOfficeClearAfterGenerate(err, written)
-
Clean after finishing to generate the document. This method destroying any additional resources added by the 'beforeGen' effect to the generator.
Name Type Description errobject Generation error message (if there were any). writtenobject Number of bytes been created. -
innercbOfficeClearDocData()
-
Clear all the information of the current document.
-
innerclearSmartArrayFromType(arr, type_to_clear)
-
Remove selected records from the given array. This method destroys records inside the given array of the given type.
Name Type Description arrobject The array to work on it. type_to_clearobject The type of records to clear. -
innercompactArray(arr)
-
Compact the given array. This function compacting the given array.
Name Type Description arrobject The array to compact. -
innergetCurDateTimeForOffice()
-
Generate string of the current date and time. This method generating a string with the current date and time in Office XML format.
Returns:
String of the current date and time in Office XML format.