Skip to content

Commit adbe51f

Browse files
committed
Restore stable PDF transport settings
1 parent 1bc17ae commit adbe51f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

app/components/pdfviewer.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ import {
2222
import "react-pdf/dist/Page/AnnotationLayer.css";
2323
import "react-pdf/dist/Page/TextLayer.css";
2424

25-
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
26-
"pdfjs-dist/build/pdf.worker.min.mjs",
27-
import.meta.url
28-
).toString();
25+
pdfjs.GlobalWorkerOptions.workerSrc = `https://cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
2926

3027
const buttonClass =
3128
"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded text-gray-600 dark:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed";
@@ -37,9 +34,9 @@ const SCALE_STEP = 0.2;
3734
const DEFAULT_SCALE = 1;
3835
const RENDER_WINDOW = 2;
3936
const PDF_OPTIONS = {
40-
disableAutoFetch: false,
41-
disableRange: false,
42-
disableStream: false,
37+
disableAutoFetch: true,
38+
disableRange: true,
39+
disableStream: true,
4340
};
4441

4542
type PdfViewerBoundaryProps = {

0 commit comments

Comments
 (0)