@@ -24,7 +24,7 @@ npm install pptx-automizer
2424
2525## Example
2626``` js
27- import Automizer from " pptx-automizer"
27+ import Automizer , { modify } from " pptx-automizer"
2828
2929// First, let's set some preferences
3030const automizer = new Automizer ({
@@ -63,18 +63,19 @@ pres.addSlide('image', 1, (slide) => {
6363pres .addSlide (' shapes' , 2 , (slide ) => {
6464 slide .modifyElement (' Drum' , [
6565 // You can use some of the builtin modifiers to edit a shape's xml:
66- Automizer . modify .setPosition ({x: 1000000 , h: 5000000 , w: 5000000 }),
66+ modify .setPosition ({x: 1000000 , h: 5000000 , w: 5000000 }),
6767 // Log your target xml into the console:
68- Automizer . modify .dump
68+ modify .dump
6969 ])
7070})
7171
7272// Modify an existing chart on an added slide.
7373pres .addSlide (' charts' , 2 , (slide ) => {
7474 slide .modifyElement (' ColumnChart' , [
7575 // Use an object like this to inject the new chart data.
76- // Make sure there is enough space in the template chart.
77- Automizer .modify .setChartData ({
76+ // Make sure there is enough space in the template chart,
77+ // as this will only update existing nodes.
78+ modify .setChartData ({
7879 series: [
7980 { label: ' series 1' },
8081 { label: ' series 2' },
@@ -117,4 +118,4 @@ This project is deeply inspired by:
117118* [ PptxGenJS] ( https://github.com/gitbrent/PptxGenJS )
118119* [ officegen] ( https://github.com/Ziv-Barber/officegen )
119120* [ node-pptx] ( https://github.com/heavysixer/node-pptx )
120- * [ docxtemplater] ( https://github.com/open-xml-templating/docxtemplater )
121+ * [ docxtemplater] ( https://github.com/open-xml-templating/docxtemplater )
0 commit comments