我试图让PdfSharp在Azure的功能 工作,但我有一些问题的字体在Azure的功能使用的字体
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
// Create an empty page
PdfPage page = document.AddPage();
// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);
// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
// Draw the text
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
这也是从PDFSharp示例页面的代码... 在字体行他给我以下错误...
Exception while executing function: Functions.PDFGenerationFunction. PdfSharp: Internal error. Font data could not retrieved.
我需要引用一些特殊的东西吗?或者在Azure功能中这样做是不可能的?
PDFSharp版本 - > “PDFsharp”: “1.32.3057”
和/或其它解决方案产生一个蓝色的功能在PDF文档...
正如其他地方回答:Azure函数(运行在Web应用程序的上下文中)是沙盒,并且您不能安装某些软件(activex等)。 –