Hi,
I have a problem with the XFont class. I developed an application that runs in Azure, Microsoft's cloud. This application has a class that creates a simple PDF which contains only the plain text body of an e-mail. The tests all work perfectly, but when I start my service in the Development Fabric (local cloud simulation environment), I always get an OutOfMemoryException when creating the XFont that is used in my PDF. I also get this exception when I run the service in the "real" cloud. But I think it is pretty impossible that there is really not enough memory. My application (which is not very large) is assigned 1,7 GB of RAM.
Here is the code I use:
Code:
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode);
XFont font = new XFont("Courier New", 10.0 * (127.0 / 360.0), XFontStyle.Regular, options);
I also tried:
Code:
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode);
Font f = new Font("Courier New", 10.0f, GraphicsUnit.World);
XFont font = new XFont(f, options);
But every time I want to create the XFont object, my app crashes.
Do you have any suggestions?
Thanks in advance - Andy aka fero
Edit:P.S.: I'm using PDFsharp 1.31.1789.0 GDI+ in Visual Studio 2010 RTM with Windows Azure SDK 1.1 (Feb 2010)