Japanese character are rendering as square bracket in pdf report



  • Hi sir ,
    Japanese character are rendering as square bracket in pdf report. I have seen few examples they were telling to install font packages This is my docker file. But when i try to add these font packages the error iam getting is apt-get not found. I think Docker image i am using is alphine based so we can't use apt-get because it's Ubuntu's package manager. So i try to install font package using apk add but still it doesn't works.
    Could you please reply with a solution?

    0_1633430860190_upload-62524b28-88a2-4ec0-88ed-61d2780b1add.

    Error :-

    0_1633431017048_upload-4b003438-a419-4e20-8a94-566b44bb655a



  • I didn't try to fiddle with fonts in alpine yet.... cant you use the jsreport full image?
    It's based on ubuntu and already has fonts installed.

    docker run -d -p 5488:5488 --restart always jsreport/jsreport:2.11.0
    


  • If you dont mind could you please show me one example with ubuntu based docker file for jsreport?



  • This is official jsreport "full" dockerfile, based on ubuntu
    https://github.com/jsreport/jsreport/blob/2.11.0/docker/full/Dockerfile



  • Hi sir ,

    I have modified my dockerfile. Now japanese is rendering in pdf report (My docker image is still alphine. i didnt chaged to ubuntu because you told me that fonts were already installed in ubudu due the issue in japanese language while rendering the report )
    Below i have added the the link that i refer to render the japanese language in pdf report , in that link they were asked to install package called wqy-zenhei so i added the below command in docker file
    RUN apk add wqy-zenhei --update-cache --repository https://nl.alpinelinux.org/alpine/edge/testing.
    Now report is rendering in japanese language.

    My Question is:-

    • Is this solution is correct inorder to render japanese language in pdf report for alphine based docker image?

    • Is there any problem will occur in future to the fonts of report?

    Docker File:------

    0_1633496783115_upload-383773ad-10ae-47b3-8793-9f2809d64f6a

    Link:--------

    https://stackoverflow.com/questions/49067625/how-can-i-use-chinese-in-alpine-headless-chrome



  • RUN apk add wqy-zenhei --update-cache --repository https://nl.alpinelinux.org/alpine/edge/testing.

    Yes, this looks like a proper solution, thank you for sharing.

    One note, these two lines seems redundant, because it runs already in the image you inherit FROM

    RUN npm cache clean -f
    RUN npm install jsreport@2.11.0
    


  • Thank you sir.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.