简体   繁体   中英

Dynamics CRM 2011 add font within plugin

our CRM system allows user to download info about an entity in form of pdf file. My task is to add Japanese version.
The library used to create the pdf is "itextsharp".
The problem here is font. How can I add new font or maybe there is a font with Japanese characters in the CRM?

The font is loaded in the following way:
BaseFont basefont = BaseFont.CreateFont("filename", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font(basefont);

But now where to store the "filename"?

The quick and dirty solution to adding a font into Dynamics CRM is to create a new web resource of type StyleSheet (CSS) and then add .css to the end of the file name before uploading.

eg myfont.ttf.css

CRM will think it is a StyleSheet when uploading so it will pass validation and when you go to retrieve the file in your code it will still be the font.

There was an article detailing how this works here: https://community.dynamics.com/crm/b/sonomapartners/archive/2013/07/19/font-files-as-crm-web-resources

You could also host the font somewhere else eg Azure storage or use one which is already hosted somewhere such as https://fonts.google.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM