@gaoding/pptx-to-templet
v0.1.9-beta.2
Published
convert pptx to js
Downloads
5
Keywords
Readme
PPTX-TO-TEMPLET
导入 pptx 文件到浏览器
Usage
import PPTX from '@gaoding/pptx-to-templet';
const pptx = new PPTX(zip, {fontList}, data => {
// console.log(data);
});
const layouts = await pptx.getSlides();
const tpl = {
global: {
dpi: 300,
zoom: 1
},
layouts,
version: this.editor.version,
type: 'poster'
};
this.editor.setTemplet(tpl);
Options
fontList
用于字体模糊匹配
fontList = [{
"id": 121,
"deleted": 0,
"name": "DFGirl",
"alias": "SN^·\\\u0011Ys[WOS",
"family": "SN^·\\\u0011Ys[WOS",
"style": "normal",
"weight": 400,
"ttf": "//st0.dancf.com/csc/13/fonts/0/20170229-120153-11.ttf",
"woff": "//st0.dancf.com/csc/13/fonts/0/20170229-120156-12.woff",
"ttf_size": 3812684,
"woff_size": 3812756,
"preview": {
"url": "https://st0.dancf.com/csc/12/fonts/121/20190128-171718-855f.svg",
"width": 431,
"height": 80
},
"platforms": 49,
"commercial_platforms": 0,
"clients": 1,
"commercial": 0,
"price": 0,
"status": 1,
"priority": 0,
"created_at": 1490760158,
"updated_at": 1552897533,
"lang": "en",
"sale_type": 0,
"limit_free": 0,
"purchase_link": "",
"limit_expired_at": 2524579200,
"origin_file": null,
"limit_expired": 0
}]