mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
fix(pdfpreview): Support for non-latin characters
As mentioned in https://github.com/wojtekmaj/react-pdf#support-for-non-latin-characters, pdf.js needs the bundled cMaps files to work.
This commit is contained in:
@@ -38,6 +38,10 @@ const PDFPreview: FunctionComponent<{ file: any }> = ({ file }) => {
|
|||||||
onLoadProgress={({ loaded, total }) => {
|
onLoadProgress={({ loaded, total }) => {
|
||||||
setLoadingText(`Loading PDF ${Math.round((loaded / total) * 100)}%`)
|
setLoadingText(`Loading PDF ${Math.round((loaded / total) * 100)}%`)
|
||||||
}}
|
}}
|
||||||
|
options={{
|
||||||
|
cMapUrl: `//cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/cmaps/`,
|
||||||
|
cMapPacked: true,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Page
|
<Page
|
||||||
pageNumber={pageNumber}
|
pageNumber={pageNumber}
|
||||||
|
|||||||
Reference in New Issue
Block a user