This is a migrated thread and some comments may be shown as answers.

Problem with Chinese characters in pdf output under Win Server 2008

3 Answers 274 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 Apr 2012, 03:18 PM
Hi,

I have a web app which outputs reports to pdf for users to download.  The reports contain simplified Chinese text.  I am using Arial Unicode MS font to display this and in my test environment (Win 7 Pro, VS2010) all works fine.

I've now deployed my application to a Win Server 2008 machine, which also has the Arial Unicode MS font installed, but the pdfs produced are not rendering the Chinese characters - all I get is rectangular blobs.  I'm sure that the reports are using the Arial Unicode font - some bits are in English by design and they look identical to my test environment reports.

Is there anything else I need to do in Win Server 2008 to make this work?  Any other ideas as to what might be wrong?

Thanks.

Update: it turned out that a server reboot fixed this.  The Arial Unicode font wasn't installed when I first deployed the app.  It installed fine, but my app still didn't work properly until I rebooted the server - very odd!

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Apr 2012, 01:42 PM
Hello Michael,

Actually not odd at all, by default, when you install a new font, only the current session is notified of the change. So if you're logging in to the server in a terminal services session (which seems likely) then the ASP.NET application (which will be running in a different session) will not see the change. When you reboot, the system automatically scans the font directory and "registers" all of the fonts in there into the current session.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Michael
Top achievements
Rank 1
answered on 17 Apr 2012, 02:03 PM
Hi Steve,

Thanks very much for the explanation; it would indeed explain what happened!  It would be useful if the Windows font installer warned you that teh new font would only be visible in the current session.  It seems a bit much to have to reboot a production server just to install a font - presumably there is a command line technique that will register it for all current sessions?

Anyway, thanks again.

Michael
0
Steve
Telerik team
answered on 17 Apr 2012, 02:12 PM
Hello Michael,

To "manually" register a new font, you need to call AddFontResource and pass in the path to the font. To make it slightly easier, you could make it so that your app scans the Fonts folder and calls AddFontResource on each file it finds there in it's Application_Start event. That way, when you install a new font, you can just recycle the site (e.g. edit the web.config file) and it'll re-scan all of the files.

Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Steve
Telerik team
Michael
Top achievements
Rank 1
Share this question
or