I am trying to get up and running with MigraDoc, but am having issues getting even the basic examples working. For example, when I run the following method in my asp.net application, the PDF I get sent is completely blank:
Code:
public static MemoryStream Test()
{
var document = new Document();
//document = CreateDocument();
document.Info.Title = "Test Report";
document.Info.Subject = "blah";
document.Info.Author = "Me";
var section = document.AddSection();
var p = section.AddParagraph("test");
p.AddText("Testing 1234");
var renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
renderer.Document = document;
renderer.RenderDocument();
var ms = new MemoryStream();
renderer.PdfDocument.Save(ms, false);
return ms;
}
When I copy all the methods from the tutorial at
http://www.pdfsharp.net/wiki/HelloMigraDoc-sample.ashx I also get a blank PDF. In the latter case while the PDF is blank it is 6 pages in length (which seems to be correct) and all the bookmarks are appearing correctly, but for some reason all the pages are blank.
In the former case, even though the PDF is blank the properties are correctly what I set them.
Any ideas? :-/