PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
Internal error. Font data could not retrieved. https://forum.pdfsharp.net/viewtopic.php?f=2&t=3158 |
Page 1 of 1 |
Author: | sullyc [ Thu Jul 30, 2015 1:25 pm ] |
Post subject: | Internal error. Font data could not retrieved. |
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. |
Author: | TH-Soft [ Fri Jul 31, 2015 7:14 am ] |
Post subject: | Re: Internal error. Font data could not retrieved. |
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. |
Author: | sullyc [ Fri Jul 31, 2015 7:51 am ] |
Post subject: | Re: Internal error. Font data could not retrieved. |
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. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |