| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>预览pptx</title>
- <script src="./utils/flexible.js"></script>
- <script src="./utils/ui.js"></script>
- <script src="./utils/getQueryVariable.js"></script>
- <script src="./pptx/pptx-preview.umd.js"></script>
- <link rel="stylesheet" href="./style/ui.css" />
- <style type="text/css">
- #pptx-preview {
- width: 100%;
- height: calc(100% - 10px);
- font-size: 18px;
- }
- .pptx-preview-wrapper {
- background: #fff !important;
- }
- </style>
- </head>
- <body>
- <div id="pptx-preview"></div>
- <script>
- (async function() {
- const fileUrl = decodeURIComponent(getQueryVariable('file') || '');
- const loading = createLoading();
- loading.show();
- let pptxPrviewer = pptxPreview.init(document.getElementById('pptx-preview'), {
- width: window.innerWidth || 375,
- height: window.innerHeight || 667
- });
- fetch(fileUrl)
- .then(response => {
- return response.arrayBuffer();
- })
- .then(res => {
- //调用预览器的preview方法
- pptxPrviewer.preview(res);
- })
- .finally(() => {
- // 获取页面加载完成后再关闭
- loading.hide();
- });
- })();
- </script>
- </body>
- </html>
|