Merge pull request #1830 from dolanmiu/feat/optional-background
Optional background property
This commit is contained in:
@ -8,7 +8,7 @@ import { DocumentAttributes } from "./document-attributes";
|
||||
import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background";
|
||||
|
||||
export interface IDocumentOptions {
|
||||
readonly background: IDocumentBackgroundOptions;
|
||||
readonly background?: IDocumentBackgroundOptions;
|
||||
}
|
||||
|
||||
// <xsd:element name="document" type="CT_Document"/>
|
||||
@ -73,7 +73,9 @@ export class Document extends XmlComponent {
|
||||
}),
|
||||
);
|
||||
this.body = new Body();
|
||||
this.root.push(new DocumentBackground(options.background));
|
||||
if (options.background) {
|
||||
this.root.push(new DocumentBackground(options.background));
|
||||
}
|
||||
this.root.push(this.body);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ export class File {
|
||||
this.appProperties = new AppProperties();
|
||||
this.footnotesWrapper = new FootnotesWrapper();
|
||||
this.contentTypes = new ContentTypes();
|
||||
this.documentWrapper = new DocumentWrapper({ background: options.background || {} });
|
||||
this.documentWrapper = new DocumentWrapper({ background: options.background });
|
||||
this.settings = new Settings({
|
||||
compatibilityModeVersion: options.compatabilityModeVersion,
|
||||
compatibility: options.compatibility,
|
||||
|
Reference in New Issue
Block a user