I try to get PdfSharp working in an Azure Function But I have some problems with fonts
// 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);
This is also the code from the PDFSharp sample page... At the font line he gives me the following error...
Exception while executing function: Functions.PDFGenerationFunction. PdfSharp: Internal error. Font data could not retrieved.
Do I need to reference something special? Or is it just not possible to do this in an Azure function?
PDFSharp version --> "PDFsharp" : "1.32.3057"
And/Or another solution to generate a PDF document in an Azure Function...