dnspy give me cs0012 code example

Example: Error CS0012 The type "'FontFamily'" is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationCore

You are using a version of PDFsharp that relies on GDI+ and your project may have to reference System.Drawing e.g. when you need fonts, pens, brushes, and such.
To avoid references to GDI+, you can use the WPF build of PDFsharp:
https://www.nuget.org/packages/PDFsharp-wpf/1.50.4845-RC2a
When using the WPF build you also have to add references to WPF when it comes to using fonts, pens, brushes, &c.
You need a reference to PresentationCore for the WPF build.
PDFsharp 1.50 was not designed to work with .NET Core and may not work on other platforms than Windows.