Hi,
I believe I've found a bug that causes text to disappear when drawn with DrawString and XBrushes.Black immediately after drawing a rounded rectangle with a XLinearGradientBrush.
It could be that the bug is more general than that, but this is how I bumped into it. I'm using Pdfsharp 1.0.898.
The code below should illustrate the problem (at least it does on my machine). Try removing the DrawRoundedRectangle and see what happens.
Code:
PdfDocument doc = new PdfDocument();
PdfPage page = doc.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XRect rect = new XRect(10, 10, 100, 100);
gfx.DrawRoundedRectangle(
new XPen(XColors.Black, 3),
new XLinearGradientBrush(rect, XColors.Red, XColors.Green, XLinearGradientMode.Vertical),
rect,
new XSize(5, 5));
gfx.DrawString("Some text that disappears", new XFont("Arial", 20), XBrushes.Black,
new XRect(200, 200, 200, 200), XStringFormat.TopLeft);
doc.Save("HelloWorld.pdf");
Process.Start("HelloWorld.pdf");