PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Mar 29, 2024 1:04 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Oct 02, 2015 10:49 pm 
Offline

Joined: Fri Oct 02, 2015 10:34 pm
Posts: 3
We have a C# website that is hosted using Azure Cloud Services and uses PDF Sharp to generate PDF documents.

We are using the Arial Unicode MS Regular font since we have Japanese fonts to display. When the website is run locally (from Visual Studio on Windows 7) the fonts render correctly.

We use a start-up script for Azure to install the font onto the Cloud Service servers since its not installed by default. I have verified that the font is installed on the Cloud Service servers (Windows Server 2012).

In the Azure hosted website the Japanese fonts appear as squares, even though the PDF properties do indicate that the font used is Arial Unicode MS Regular.

Any ideas why the font is not being correctly used on the Cloud Service servers?


Attachments:
File comment: The PDF generated by Windows 2012 server running on Azure. The Japanese fonts rendered as sqaures but the properties indicate the unicode font was used.
japanese.png
japanese.png [ 41.78 KiB | Viewed 8679 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 03, 2015 6:30 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
joechip wrote:
Any ideas why the font is not being correctly used on the Cloud Service servers?
No!

I would try the WPF build of PDFsharp 1.50 beta 2 and supply the font from a Font Resolver.


AFAIK the Azure servers simply ignore some calls - no exceptions, but you do not get what you expect. Maybe the font did not get installed, maybe PDFsharp cannot access the bytes of the font.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2015 10:39 pm 
Offline

Joined: Fri Oct 02, 2015 10:34 pm
Posts: 3
Thanks! That helped me to solve the issue :D

I've posted the full details here: http://stackoverflow.com/questions/32913079/azure-pdf-sharp-not-using-unicode-font/32980927#32980927

But the basic overview is that I did have to use the WPF build of PDFsharp 1.50 beta 2 and a FontResolver.
The link which helped me with the FontResolver was: http://developer.th-soft.com/developer/using-private-fonts-with-pdfsharp-1-50-beta-2-or-migradoc/
The font needed to be added as an embedded resource into the project.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 07, 2015 6:07 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
joechip wrote:
The font needed to be added as an embedded resource into the project.
It should also work if you publish the font files as "content" along with project, but I never tried that. With embedded resources, the fonts cannot get accidentally deleted.

Thanks for the feedback!

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 21, 2015 11:16 pm 
Offline

Joined: Wed Oct 21, 2015 11:14 pm
Posts: 2
How about someone using a "cheaper" hosting solution on Azure and we can not install a font. Will including it int he fonts folder of the web application suffice? I just can not believe a windows hosting solution does not have the standard set of fonts (arial, verdana, times, courier, etc...) !


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 22, 2015 5:35 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
mbowles201 wrote:
I just can not believe a windows hosting solution does not have the standard set of fonts (arial, verdana, times, courier, etc...) !
Maybe they are there, maybe they can be used to draw text on bitmaps. PDFsharp has to embed them in the PDF and getting the byte[] with the font data is the problem on those hosting solutions.

The IFontResolver solution does work there.

_________________
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  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 133 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