fix: increase res
@ -193,7 +193,7 @@ async function renderPdfToImage(pdfBytes: Uint8Array) {
|
||||
const pdf = await loadingTask.promise;
|
||||
|
||||
// Increase for higher resolution
|
||||
const scale = 2;
|
||||
const scale = 4;
|
||||
|
||||
return await Promise.all(
|
||||
Array.from({ length: pdf.numPages }, async (_, index) => {
|
||||
@ -203,6 +203,7 @@ async function renderPdfToImage(pdfBytes: Uint8Array) {
|
||||
|
||||
const virtualCanvas = new Canvas(viewport.width, viewport.height);
|
||||
const context = virtualCanvas.getContext('2d');
|
||||
context.imageSmoothingEnabled = false;
|
||||
|
||||
// @ts-expect-error skia-canvas context satisfies runtime requirements for pdfjs
|
||||
await page.render({ canvasContext: context, viewport }).promise;
|
||||
|
||||
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 117 KiB |