I am looking for solution generating pdf file from string using Xamarin ( Xamarin Forms or Xamarin iOS).
I have found libraries like iTextSharp, SelectPDF or Syncfusion and other but all of them must be paid. I need entirely free solution.
PDFsharp library almost works:
PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
const string filename = "HelloWorld.pdf";
document.Save(filename);
But at 'XFont" there is an error: "Reference to type 'FontFamily' claims it is defined in 'System.Drawing', but it could not be found".
Apple provides solution: link but this is objective-c that I am not familiar with and there are a lot of errors when I paste this code in Visual Studio.
Have you got solution written in C#?