31
Views
1
Comments
[pdfJS Viewer Reactive] PDFs with Traditional Chinese characters are not rendering
pdfjs-viewer-reactive
Reactive icon
Forge asset by Eduardo Jauch
Application Type
Reactive

Hi,

I need some help with overcoming an issue with the pdfJS viewer not correctly rendering Chinese characters.

We have installed version 1.05 of the pdfJS Viewer Reactive Forge component.

We are using the PDFJSViewerBase64 block to open up a PDF file on our website page.

The viewer works fine for English PDF files but for Traditional Chinese PDF files, some of the characters are not rendering. 

We can see there is an error raised trying to fetch the Adobe-CNS1-UCS2.bcmap file.

I can see the Adobe-CNS1-UCS2.bcmap file in the resources of the pdfJsViewerReactive module but if I go to the runtime path, the file can't be found.

I saw a previous support post that also had issues with Japanese characters in the PDF files. https://www.outsystems.com/forums/discussion/91208/pdfjs-viewer-reactive-request-for-correction-of-a-bug-that-prevents-the-display/

I tried changing the cMapUrl in viewer.js  from "../web/cmaps/"  to ""../cmaps/" as suggested in that post but still got the same error.

  cMapUrl: {

    value: "../cmaps/",

    kind: OptionKind.API

  }

Is there a configuration that needs to be set or something that needs to be updated to change the cMapURL? 

Any help to resolve this issue would be appreciated.

Thanks.

UserImage.jpg
Brian Teo
Staff

This might be due to the mime type (.bcmap) that is not included by default. You can try the following:
1. Add the mime type using Factory Configuration, please refer to this article
2. Apply the mime type on pdfJSViewerReactive espace
3. Republish the pdfJSViewerReactive module
4. Republish your main module
5. Access via "https://<Environment URL>/pdfJSViewerReactive/web/cmaps/Adobe-CNS1-UCS2.bcmap" to see if the file get downloaded
 
Sometimes when you apply the factory configuration, it will take sometime for the settings to be applied. Thus, after publishing, do wait for around 10 minutes before you test it. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.