Skip to content

Commit 1baa407

Browse files
committed
feature(use): add image from scratch #60 #62
1 parent adfe37f commit 1baa407

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/dev.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import Automizer, {
2-
CmToDxa,
3-
ISlide,
4-
ModifyColorHelper,
5-
ModifyShapeHelper,
6-
ModifyTextHelper,
7-
} from './index';
8-
import { vd } from './helper/general-helper';
1+
import Automizer from './index';
92
import pptxgen from 'pptxgenjs';
103

114
const run = async () => {
@@ -23,6 +16,12 @@ const run = async () => {
2316
objectName: 'Text 1',
2417
};
2518
slide.addText(textboxText, textboxOpts);
19+
slide.addImage({
20+
path: 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg',
21+
objectName: 'Image 1',
22+
x: 1,
23+
y: 2,
24+
});
2625

2726
await presPptxGen.writeFile({
2827
fileName: templateDir + '/presPptxGenTmp.pptx',
@@ -41,6 +40,7 @@ const run = async () => {
4140

4241
pres.addSlide('shapes', 1, (slide) => {
4342
slide.addElement('presPptxGenTmp', 1, 'Text 1');
43+
slide.addElement('presPptxGenTmp', 1, 'Image 1');
4444
});
4545

4646
pres.write(`myOutputPresentation.pptx`).then((summary) => {

0 commit comments

Comments
 (0)