PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Thu Oct 02, 2025 10:46 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jul 30, 2015 1:25 pm 
Offline

Joined: Mon Jun 08, 2015 1:44 pm
Posts: 4
Picked up a project. This was using PDFSharp 1.32 WPF build to generate pdfs which didn't seem to support rtf generation so I swapped in the GDI+ nuget package instead. Great, can generate rtfs. Deploy to staging server (Azure) and can't generate any pdfs. 'Internal error. Font data could not retrieved.' I'm guessing installing fonts to Azure will be problematic. Google says 'private fonts' are the answer.

But google also found this in another post: 'You obviously are using the GDI+ build of PDFsharp 1.32. Private fonts do not work with the GDI+ build 1.32, so please try the WPF build.' (http://forum.pdfsharp.net/viewtopic.php ... 1745#p8963)

Given all this, what is my best way forward?

Stack trace:

[InvalidOperationException: Internal error. Font data could not retrieved.]
PdfSharp.Fonts.OpenType.FontData.CreateGdiFontImage(XFont font, XPdfFontOptions options) +452
PdfSharp.Fonts.OpenType.FontData..ctor(XFont font, XPdfFontOptions options) +53
PdfSharp.Fonts.OpenType.OpenTypeDescriptor..ctor(XFont font, XPdfFontOptions options) +85
PdfSharp.Fonts.FontDescriptorStock.CreateDescriptor(XFont font) +173
PdfSharp.Drawing.XFont.get_Metrics() +29
PdfSharp.Drawing.XFont.Initialize() +172
MigraDoc.Rendering.FontHandler.FontToXFont(Font font, XPrivateFontCollection pfc, PdfFontEncoding encoding, PdfFontEmbedding fontEmbedding) +140
MigraDoc.Rendering.ParagraphRenderer.get_CurrentFont() +40
MigraDoc.Rendering.ParagraphRenderer.InitFormat(Area area, FormatInfo previousFormatInfo) +459
MigraDoc.Rendering.ParagraphRenderer.Format(Area area, FormatInfo previousFormatInfo) +62
MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel) +726
MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx) +916
MigraDoc.Rendering.DocumentRenderer.PrepareDocument() +389
MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer(Boolean prepareCompletely) +113
MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages() +19
MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument() +13

Ta.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 31, 2015 7:14 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1057
Location: CCAA
RTF generation works with all builds (WPF and GDI+).

With version 1.32, you need WPF build for private fonts. So just switch back.
Or try PDFsharp 1,50 beta (from NuGet) with a new implementation for private fonts.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 31, 2015 7:51 am 
Offline

Joined: Mon Jun 08, 2015 1:44 pm
Posts: 4
Thanks. Don't recall what my rtf issues were before that led me to my errant conclusion but switched to WPF version and all working in Azure without any meddling further with private fonts, so the GDI+ error message must have been hiding a sub-issue.


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

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 535 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