Skip to content

Commit f1a659a

Browse files
committed
fix: Fixing issue with unknown chars breaking pages
1 parent 999f8a9 commit f1a659a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/renderers/pdf/components/pages/PDFPages.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable */
22
import React, { FC, useContext, useEffect } from "react";
3-
import { Document } from "react-pdf";
3+
import { Document, pdfjs } from "react-pdf";
44
import styled from "styled-components";
55
import { useTranslation } from "../../../../hooks/useTranslation";
66
import { PDFContext } from "../../state";
@@ -29,6 +29,10 @@ const PDFPages: FC<{}> = () => {
2929
file={currentDocument.fileData}
3030
onLoadSuccess={({ numPages }) => dispatch(setNumPages(numPages))}
3131
loading={<span>{t("pdfPluginLoading")}</span>}
32+
options={{
33+
cMapUrl: `https://cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/cmaps/`,
34+
cMapPacked: true,
35+
}}
3236
>
3337
{paginated ? <PDFSinglePage /> : <PDFAllPages />}
3438
</DocumentPDF>

0 commit comments

Comments
 (0)