cancel
Showing results for 
Search instead for 
Did you mean: 

under linux Preview Chinese font is incorrect

fanhuibin1
Champ in-the-making
Champ in-the-making
when i try to Transform <strong> text into pdf </strong>
1.configed use openoffice as  default Converter
2.when use windows everything is ok,the default font use in pdf is<strong> simsun </strong>
3.but when i use linux ,the font used in the pdf is incorrect , this font Does not support Chinese

<strong>Can anyone tell me,when i use openoffice convert fonts how to set the default font? or Any other solutions</strong>

I see in the package net.sf.jooreports.openoffice.converter;
OpenOfficeDocumentConverter.java

  private void loadAndExport(String inputUrl, String outputUrl, PropertyValue[] exportProperties) throws Exception {
    XComponentLoader desktop = this.openOfficeConnection.getDesktop();
    XComponent document;
    if(!isTextUtf8() ){
        PropertyValue propertyValues[]=new PropertyValue[]{property("ReadOnly",Boolean.TRUE),property("Hidden", Boolean.TRUE)};
        document = desktop.loadComponentFromURL(inputUrl, "_blank", 0, propertyValues);
    }else{
       PropertyValue propertyValues[] = new PropertyValue[] {
                property("ReadOnly", Boolean.TRUE),
                property("FilterOptions", "utf8"),
                property("FilterName", "Text (encoded)"),
                property("UpdateDocModel", ONE),
                property("Hidden", Boolean.TRUE) } ;
       document = desktop.loadComponentFromURL(inputUrl, "_blank", 0, propertyValues);
    }
    refreshDocument(document);
    try
    {
      XStorable storable = (XStorable)UnoRuntime.queryInterface(XStorable.class, document);
      storable.storeToURL(outputUrl, exportProperties);// how to set default font ?
    } finally {
      document.dispose();
    }
  }


2 REPLIES 2

fanhuibin1
Champ in-the-making
Champ in-the-making
Add one more point  I have added the simsun Nsimsun And other common Chinese font to the linux system ,what can i do now ? 

binerf
Champ in-the-making
Champ in-the-making
Hi,

I'm also facing the same issue.

Anybody could help us please ?

Thanks in advance.