PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Apr 24, 2024 11:22 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Sep 02, 2016 9:59 am 
Offline

Joined: Fri Sep 02, 2016 9:49 am
Posts: 1
Dear all,

I have created a program to insert Chinese with font type Microsoft JhengHei under Windows 7. However when I deploy to Windows Server 2012, Migradoc fail to embed the font into pdf and it also embed Microsoft Sans Serif and the Chinese Characters become square.

I have tried to change the font name "Microsoft JhengHei", "Microsoft JhengHei Regular", which fit the font name in control panel.

Here is my code piece:
Code:
string fontChi = "Microsoft JhengHei";
Font fChi = new Font(fontChi);
Style s2 = document.Styles["Heading1"];
s2.Font.ApplyFont(fChi);
s2.Font.Size = 15;
s2.ParagraphFormat.Alignment = ParagraphAlignment.Center;

cell.AddParagraph("Some chinese...").Style = "Heading1";


Is there any server configuration in Windows Server 2012 needed in order to make MigraDoc working? Thanks in advance.

Regards,
Peter


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 02, 2016 10:28 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
Hi, Peter!
peterlcf wrote:
Is there any server configuration in Windows Server 2012 needed in order to make MigraDoc working?
Using a Font Resolver will be the clean way.

Granting more permissions to the MigraDoc process (e.g. the Application Pool when run under IIS) should also do the trick.

See also:
viewtopic.php?p=9576#p9576
http://pdfsharp.net/wiki/Private%20Fonts.ashx

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 285 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group