File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/document-loaders/src/utils/pdf Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @callstack/document-loaders ' : patch
3
+ ---
4
+
5
+ Added src for pdf worker
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import { orderBy } from 'lodash';
4
4
import { getLinkBoundingBoxes , PdfLinkBoundingBox } from './links.js' ;
5
5
import { boundingBoxesOverlap , expandBoundingBox } from './bounding-box.js' ;
6
6
7
+ // Makes parser available in bundle when document-loaders are used as dependency
8
+ pdfjs . GlobalWorkerOptions . workerSrc = require . resolve ( 'pdfjs-dist/build/pdf.worker.min.js' ) ;
9
+
7
10
export async function loadPdfContentFromBuffer ( buffer : ArrayBuffer ) : Promise < string > {
8
11
const document = await pdfjs . getDocument ( buffer ) . promise ;
9
12
let text = '' ;
You can’t perform that action at this time.
0 commit comments