Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-21908 Non-latin Chinese/Japanese characters are not supported in PDF file
  3. SAK-21922

In wiki tool, non-latin (Japanese/Chinese) characters are not supported while export site members in PDF file.

    XMLWordPrintable

    Details

      Description

      To show the bug:
      1. Create a Wiki page contains non-latin(Chinese, in my case) content. You can just copy some Chinese characters from zh.wikipedia.org
      2. Enter "info" page of the Wiki page. In "Views and Feeds", click "PDF". The exported PDF file render Chinese characters incorrectly.
      Screen shots can be found in attachment.

      Patch:
      In folder rwiki/rwiki-impl/impl
      1. Modify sakai.properties
      Add an entry: fop.pdf.default.font=AR PL UMing CN
      "AR PL UMing CN" is a Chinese font. In Linux, it can be installed via "ttf-arphic-uming'
      Admin can set this to any font he/she like, only if the font is installed in the OS.

      2. Modify pom.xml
      Update Apache FOP version from 0.9.3 to 1.0

      3. Modify src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/fop.cfg.xml
      Add some code to let FOP auto detect System fonts.

      4. Modify src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/xhtml2fo.xslt
      Set fo:root font to DEFAULT_FONT

      5. Modify src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/BaseFOPSerializer.java
      Update the FOP related code to couple with FOP 1.0.

      6. Modify src/test/uk/ac/cam/caret/sakai/rwiki/component/service/impl/test/XSLTEntityHandlerTest.java
      Remove a test case which would not pass compile check due to changes of FOP API

      I modify the code based on Sakai 2.8.1. The source and "diff" are in the attachment(without sakai.properties).
      Also, you can see the effect after fix the bug as attachment

        Gliffy Diagrams

          Zeplin

            Attachments

            1. rwiki_SAK-21922.patch.txt
              7 kB
            2. rwiki.diff
              7 kB
            3. sakai-rwiki-impl.tar.gz
              16 kB
            4. test.pdf
              29 kB
            5. test.png
              test.png
              49 kB
            6. Wiki-bug.png
              Wiki-bug.png
              29 kB
            7. Wiki-fix.png
              Wiki-fix.png
              111 kB

              Issue Links

                Activity

                  People

                  Assignee:
                  buckett Matthew Buckett
                  Reporter:
                  gaojun Gao Jun
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration