mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-23 00:31:06 +08:00
fix(web): pass pdf.js cMap/standard font URLs so CID-font PDFs render in preview (#18249)
This commit is contained in:
@@ -33,6 +33,7 @@ import { getAuthorization } from '@/utils/authorization-util';
|
||||
import { useCatchDocumentError } from './hooks';
|
||||
type PdfLoaderProps = React.ComponentProps<typeof PdfLoader> & {
|
||||
httpHeaders?: Record<string, string>;
|
||||
standardFontDataUrl?: string;
|
||||
};
|
||||
|
||||
const Loader = PdfLoader as React.ComponentType<PdfLoaderProps>;
|
||||
@@ -100,6 +101,9 @@ const PdfPreview = ({
|
||||
</div>
|
||||
}
|
||||
workerSrc="/pdfjs-dist/pdf.worker.min.js"
|
||||
cMapUrl="/pdfjs-dist/cmaps/"
|
||||
cMapPacked={true}
|
||||
standardFontDataUrl="/pdfjs-dist/standard_fonts/"
|
||||
errorMessage={<FileError>{error}</FileError>}
|
||||
>
|
||||
{(pdfDocument) => {
|
||||
|
||||
Reference in New Issue
Block a user