@@ -28,25 +28,21 @@ import Automizer from "pptx-automizer"
2828const automizer = new Automizer
2929
3030// First, lets set some preferences
31- const templateFolder = ` my/pptx/templates/ `
32- const outputFolder = ` my/pptx/output/ `
31+ const templateFolder = ` my/pptx/templates`
32+ const outputFolder = ` my/pptx/output`
3333
3434// Let's start and import a root template. All slides will be appended to
35- // any existing slide in RootTemplate.pptx
36- let pres = automizer .importRootTemplate (` ${ templateFolder} RootTemplate.pptx` )
35+ // any existing slides in RootTemplate.pptx
36+ let pres = automizer .importRootTemplate (` ${ templateFolder} / RootTemplate.pptx` )
3737 // We want to make two files available and give them a handy label.
38- .importTemplate (` ${ templateFolder} SlideWithShapes.pptx` , ' shapes' )
39- .importTemplate (` ${ templateFolder} SlideWithGraph.pptx` , ' graph' )
38+ .importTemplate (` ${ templateFolder} / SlideWithShapes.pptx` , ' shapes' )
39+ .importTemplate (` ${ templateFolder} / SlideWithGraph.pptx` , ' graph' )
4040
41- // addSlide takes two arguments: The first will specify the source presentation
42- // where your template should come from, the second will set the slide number.
41+ // addSlide takes two arguments: The first will specify the source presentation's
42+ // label to take the template from, the second will set the slide number to require .
4343pres .addSlide (' graph' , 1 )
44-
45- // You can also loop through something and add slides in a batch.
46- for (let i= 0 ; i<= 10 ; i++ ) {
47- pres .addSlide (' shapes' , 1 )
48- }
44+ .addSlide (' shapes' , 1 )
4945
5046// Finally, we want to write the output file.
51- pres .write (` ${ outputFolder} myPresentation.pptx` )
47+ pres .write (` ${ outputFolder} / myPresentation.pptx` )
5248```
0 commit comments