Wir erstellen ein PDFDocument, kein (Migradoc) Dokument

static void Main()
{
  DateTime now = DateTime.Now;
  string filename = "MixMigraDocAndPdfSharp.pdf";
  filename = Guid.NewGuid().ToString("D").ToUpper() + ".pdf";
  PdfDocument document = new PdfDocument();
  document.Info.Title = "PDFsharp XGraphic Sample";
  document.Info.Author = "Stefan Lange";
  document.Info.Subject = "Created with code snippets that show the use of graphical functions";
  document.Info.Keywords = "PDFsharp, XGraphics";
 
  SamplePage1(document);
 
  SamplePage2(document);
 
  Debug.WriteLine("seconds=" + (DateTime.Now - now).TotalSeconds.ToString());
 
  // Save the document...
  document.Save(filename);
  // ...and start a viewer
  Process.Start(filename);
}
Happy Hyena