Skip to content

Commit

Permalink
Merge pull request #10 from ielijose/master
Browse files Browse the repository at this point in the history
Add Rectangle to master slide shapes
  • Loading branch information
gitbrent authored Nov 18, 2016
2 parents 9d63be4 + 9e6a827 commit c62eecc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,24 @@ E.g.: `<script lang="javascript" src="pptxgenjs.masters.js"></script>`
`pptxgenjs.masters.js` contents:
```javascript
var gObjPptxMasters = {
MASTER_SLIDE: {
title: 'Basic corp slide master',
isNumbered: true,
margin: [ 0.5, 0.25, 1.0, 0.25 ],
bkgd: 'FFFFFF',
images: [ { src:'images/logo_square.png', x:9.3, y:4.9, cx:0.5, cy:0.5 } ],
shapes: [
{ type:'text', text:'ACME - Confidential', x:0, y:5.17, cx:'100%', cy:0.3, align:'center', valign:'top', color:'7F7F7F', font_size:8, bold:true }
]
},
TITLE_SLIDE: {
title: 'I am the Title Slide',
isNumbered: false,
bkgd: { src:'images/title_bkgd.png', data:'base64,R0lGONlhotPQBMAPyoAPosR[...]+0pEZbEhAAOw==' },
images: [ { src:'images/sample_logo.png', x:'7.4', y:'4.1', cx:'2', cy:'1', data:'image/gif;base64,R0lGODlhPQBEAPeoAJosM[...]+0pCZbEhAAOw==' } ]
}
MASTER_SLIDE: {
title: 'Basic corp slide master',
isNumbered: true,
margin: [ 0.5, 0.25, 1.0, 0.25 ],
bkgd: 'FFFFFF',
images: [ { src:'images/logo_square.png', x:9.3, y:4.9, cx:0.5, cy:0.5 } ],
shapes: [
{ type:'text', text:'ACME - Confidential', x:0, y:5.17, cx:'100%', cy:0.3, align:'center', valign:'top', color:'7F7F7F', font_size:8, bold:true },
{ type:'line', x:0.3, y:3.85, cx:5.7, cy:0.0, line:'007AAA' },
{ type:'rectangle', x:0, y:0, w:'100%', h:.65, cx:5, cy:3.2, fill:'003b75' },
]
},
TITLE_SLIDE: {
title: 'I am the Title Slide',
isNumbered: false,
bkgd: { src:'images/title_bkgd.png', data:'base64,R0lGONlhotPQBMAPyoAPosR[...]+0pEZbEhAAOw==' },
images: [ { src:'images/sample_logo.png', x:'7.4', y:'4.1', cx:'2', cy:'1', data:'image/gif;base64,R0lGODlhPQBEAPeoAJosM[...]+0pCZbEhAAOw==' } ]
}
};
```
#### PRO-TIP: Pre-encode Images for Performance Boost
Expand Down
1 change: 1 addition & 0 deletions dist/pptxgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ var PptxGenJS = function(){
// 2: Create object using 'type'
if ( shape.type == 'text' ) slideObj.addText(shape.text, objOpts);
else if ( shape.type == 'line' ) slideObj.addShape(gObjPptxShapes.LINE, objOpts);
else if ( shape.type == 'rectangle' ) slideObj.addShape(gObjPptxShapes.RECTANGLE, objOpts);
});
}

Expand Down

0 comments on commit c62eecc

Please sign in to comment.