Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

chinese incorrect codes #7

Open
yukixiong opened this issue May 14, 2016 · 8 comments
Open

chinese incorrect codes #7

yukixiong opened this issue May 14, 2016 · 8 comments

Comments

@yukixiong
Copy link

第1章绪论练习题

一、判断题

  1. 数据元素是数据的最小单位。( )
  2. 记录是数据处理的最小单位。 ( )
  3. 数据的逻辑结构是指数据的各数据项之间的逻辑关系。( )
    4.算法的优劣与算法描述语言无关,但与所用计算机有关。( )
    5.健壮的算法不会因非法的输入数据而出现莫名其妙的状态。( )
    6.数据的物理结构是指数据在计算机内的实际存储形式。( )
  4. 数据结构的抽象操作的定义与具体实现有关。( )
    Libraries are outdated #1
  1. #############( )
  2. ############# ( )
  3. ########################( )
    4##########################( )
    5###########################( )
    6#########################( )
  4. ####################( )
@yeokm1
Copy link
Owner

yeokm1 commented Jun 6, 2016

I have run your request via Google Translate into English but I do not understand your request.

@yukixiong
Copy link
Author

I am sorry After publish my project to the linux server, when the document contains Chinese, pdf no Chinese. Just like upstairs --Chinese garbled.

@yeokm1
Copy link
Owner

yeokm1 commented Jun 10, 2016

Oh, I have never tested the app with non-English characters. I depend on external libraries to handle the conversion. If they can't manage those characters then I can't do anything about it.

@yukixiong
Copy link
Author

Thank you very much. It`s my fault. I forgot to install fonts library on my server. Thanks again!!!

@littlebox692
Copy link

I met the same issue as yours.Have you ever fixed this probelm? @yukixiong ,how to convert doc to pdf with chinese characters.

@co-kevin
Copy link

Simple docx to pdf convert. Use font provider fix it. Copy any ttf font from Windows c:/Windows/Fonts to src/main/resources

XWPFDocument document = new XWPFDocument(file);
PdfOptions options = PdfOptions.create();
options.fontProvider(new ITextFontRegistry() {
    public Font getFont(String familyName, String encoding, float size, int style, Color color) {
        try {
            BaseFont bfChinese =
                BaseFont.createFont("font/PingFang_Regular.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            Font fontChinese = new Font(bfChinese, size, style, color);
            if (familyName != null)
                fontChinese.setFamily(familyName);
            return fontChinese;
        } catch (Throwable e) {
            e.printStackTrace();
            // An error occurs, use the default font provider.
            return ITextFontRegistry.getRegistry().getFont(familyName, encoding, size, style, color);
        }
    }
});
PdfConverter.getInstance().convert(document, os, options);

@wanglewoba
Copy link

@littlebox692 Have you ever fixed this probelm?

@chengqun2
Copy link

@yukixiong @littlebox692 @sunwenwu 请问你们解决中文变成#号的问题没?
Have you solved the problem of Chinese becoming ##?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants