webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

Special font do not display on Debian server. #136

Open dzhuang opened 9 years ago

dzhuang commented 9 years ago

I am using ViewerJS to display a PDF file in my Debian server, with Adobe-GB1-UCS2 font in the document, and that font is installed in the server with path /usr/share/poppler/cMap/Adobe-GB1. I got the following error in the log.

"GET /ViewerJS/nullAdobe-GB1-UCS2 HTTP/1.1" 404

and all the Chinese characters are not visible. However, if running on a windows server, it works without problem (like a charm), so I think it may not be the problem of ViewerJS. Should I use @font-face as what was suggested in the instructions? If yes, how?

Another question is why there is a null string in the error message.

Thanks for your job!

update: I think maybe it is a problem with pdf.js as my pdf file is generated by xelatex.

chenzx commented 8 years ago

Hi, i found the fix: need config the cmap:

//#if (FIREFOX || MOZCENTRAL || GENERIC || CHROME) //PDFJS.workerSrc = '../build/pdf.worker.js'; //#endif //#if !PRODUCTION PDFJS.cMapUrl = '../external/bcmaps/'; PDFJS.cMapPacked = true; //#else //PDFJS.cMapUrl = '../web/cmaps/'; //PDFJS.cMapPacked = true; //#endif