docs: 更新README和index.html,添加NGINX配置和浏览器兼容性说明
更新了README.md文件,增加了NGINX配置示例、浏览器兼容性说明、隐私说明和致谢部分。同时,修改了index.html文件,添加了favicon图标并调整了JS文件的加载顺序,确保FileSaver.js先加载。
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
// 导入依赖库
|
||||
import * as pdfjsLib from './pdf.mjs';
|
||||
import JSZip from './jszip.min.js';
|
||||
|
||||
// 设置PDF.js worker路径
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'cssjs/js/pdf.worker.js';
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'cssjs/js/pdf.worker.mjs';
|
||||
|
||||
// 全局变量
|
||||
let pdfDocument = null;
|
||||
@@ -25,12 +29,6 @@ const pdfPagesValue = document.getElementById('pdf-pages-value');
|
||||
|
||||
// 事件监听器
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 检查PDF.js是否正确加载
|
||||
if (typeof pdfjsLib === 'undefined') {
|
||||
alert('PDF.js库加载失败,请确保pdf.js文件已正确放置');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化事件监听
|
||||
initEventListeners();
|
||||
});
|
||||
@@ -67,6 +65,9 @@ function initEventListeners() {
|
||||
});
|
||||
}
|
||||
|
||||
// 其余函数保持不变
|
||||
// ...
|
||||
|
||||
// 处理文件选择
|
||||
function handleFileSelect(e) {
|
||||
const file = pdfFileInput.files[0];
|
||||
@@ -345,6 +346,7 @@ function exportMultipleImages(scale) {
|
||||
|
||||
// 如果所有页面都已处理,生成并下载zip
|
||||
if (processedCount === renderedPages.length) {
|
||||
// 生成并下载zip文件
|
||||
zip.generateAsync({ type: 'blob' }).then(content => {
|
||||
saveAs(content, `${pdfFile.name.replace('.pdf', '')}_images.zip`);
|
||||
loadingContainer.style.display = 'none';
|
||||
|
||||
Reference in New Issue
Block a user