2017-07-18 28 views
0

我試圖讓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文檔...

+1

正如其他地方回答:Azure函數(運行在Web應用程序的上下文中)是沙盒,並且您不能安裝某些軟件(activex等)。 –

回答