one lazy ai
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m24s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m24s
This commit is contained in:
@@ -117,11 +117,30 @@ export const flyerWorker = new Worker<FlyerJobData>(
|
||||
},
|
||||
context: {
|
||||
canvas: null as any, // This will be set below
|
||||
getImageData: () => ({ data: new Uint8ClampedArray(viewport.width * viewport.height * 4) }),
|
||||
// Add stub methods that pdf.js calls during rendering.
|
||||
fillRect: () => {},
|
||||
getImageData: () => ({ data: new Uint8ClampedArray(viewport.width * viewport.height * 4) }), // The most important part for capturing data
|
||||
// Add a comprehensive set of stub methods that pdf.js might call during rendering.
|
||||
// These don't need to do anything; they just need to exist to prevent "is not a function" errors.
|
||||
save: () => {},
|
||||
restore: () => {},
|
||||
transform: () => {},
|
||||
setTransform: () => {},
|
||||
scale: () => {},
|
||||
rotate: () => {},
|
||||
translate: () => {},
|
||||
beginPath: () => {},
|
||||
moveTo: () => {},
|
||||
lineTo: () => {},
|
||||
closePath: () => {},
|
||||
stroke: () => {},
|
||||
fill: () => {},
|
||||
clip: () => {},
|
||||
fillRect: () => {},
|
||||
strokeRect: () => {},
|
||||
clearRect: () => {},
|
||||
drawImage: () => {},
|
||||
createPattern: () => ({}),
|
||||
createLinearGradient: () => ({ addColorStop: () => {} }),
|
||||
createRadialGradient: () => ({ addColorStop: () => {} }),
|
||||
},
|
||||
};
|
||||
canvasAndContext.context.canvas = canvasAndContext.canvas;
|
||||
|
||||
Reference in New Issue
Block a user