通过函数创建 Worker 参考:PDF 转图片 1function createWorker(fn) { 2 const blob = new Blob( 3 [`(${fn.toString()})()`], 4 { type: 'application/javascript' } 5 );