Dim e As RequestEventArgs = args(0)
Dim sb As New StringBuilder
sb.AppendLine("<!DOCTYPE html Public '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>")
sb.AppendLine("<html>")
sb.AppendLine("<head>")
sb.AppendLine("<meta charset='utf-8'>")
sb.AppendLine("<script Type='text/javascript' language='javascript' src='https://cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/build/pdf.js'></script>")
sb.AppendLine("<script Type='text/javascript' language='javascript' src='https://cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/web/pdf_viewer.js'></script>")
sb.AppendLine("<meta name='viewport' c />")
'sb.AppendLine("<script src='../mui/js/mui.min.js'></script>")
'sb.AppendLine("<script src='../mui/js/pdfobject.js'></script>")
'sb.AppendLine("<link href='../mui/css/mui.css' rel='stylesheet'/>")
'sb.AppendLine("<script Type='text/javascript' charset='utf-8'>mui.init();</script>")
sb.AppendLine("</head>")
sb.AppendLine("<body>")
sb.AppendLine("<header class='mui-bar mui-bar-nav mui-bar-nav-bg'>")
sb.AppendLine("<a id='icon-menu' class='mui-action-back mui-icon mui-icon-left-nav mui-pull-left'></a>")
sb.AppendLine("<h1 class='mui-title'>延期开学通知</h1>")
sb.AppendLine("</header>")
'sb.AppendLine("<div class='mui-content'>")
sb.AppendLine("<div style='width:100%;text-align: center;position: fixed;bottom: 10px;'><button id='prev'>上一页</button><span><span id='page_num'></span> / <span id='page_count'></span></span><button id='next'>下一页</button></div><canvas id='the-canvas'></canvas>")
sb.AppendLine("<script id='script'>var url = './pdf/gg1/gg2.pdf' pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/build/pdf.worker.js';var pdfDoc = null,pageNum = 1,pageRendering = False,pageNumPending = null,scale = 1,canvas = document.getElementById('the-canvas'),ctx = canvas.getContext('2d');")
sb.AppendLine("Function renderPage(num) {pageRendering = true;pdfDoc.getPage(num).Then(Function(page) {var viewport = page.getViewport(scale);canvas.height = viewport.height;canvas.width = viewport.width;var renderContext = {canvasContext: ctx,viewport: viewport};")
sb.AppendLine("var renderTask = page.render(renderContext);renderTask.promise.Then(Function() {pageRendering = false;if (pageNumPending !== null) {renderPage(pageNumPending);pageNumPending = null;}});});")
sb.AppendLine("document.getElementById('page_num').textContent = pageNum;}")
sb.AppendLine("Function queueRenderPage(num) {If (pageRendering) {pageNumPending = num;} Else {renderPage(num);}}")
sb.AppendLine("Function onPrevPage() {If (pageNum <= 1) {return;}pageNum--;queueRenderPage(pageNum);}document.getElementById('prev').addEventListener('click', onPrevPage);")
sb.AppendLine("Function onNextPage() {If (pageNum >= pdfDoc.numPages) {return;}pageNum++;queueRenderPage(pageNum);}document.getElementById('next').addEventListener('click', onNextPage);")
sb.AppendLine("pdfjsLib.getDocument(url).Then(Function(pdfDoc_) {pdfDoc = pdfDoc_;document.getElementById('page_count').textContent = pdfDoc.numPages;renderPage(pageNum);});</script>")
sb.AppendLine("</body>")
sb.AppendLine("</html>")
e.WriteString(sb.ToString)
e.Handled=True
老师,我在hbulider测试可以使用,我为了测试将其不动移到FT中就不能显示出文件了呢,请帮看下哪里有问题