PDFsharp & MigraDoc Foundation

Could not find a part of the path '/usr/share/fonts/truetype
Page 1 of 1

Author:  Achristie [ Thu Dec 12, 2019 11:54 am ]
Post subject:  Could not find a part of the path '/usr/share/fonts/truetype

Hi, Im using PDFSharp.Xamarin to try to create a PDF from some data gathered in a form, i have managed to get the code to compile however im now getting a runtime error using my android emulator,

Error: System.IO.DirectoryNotFoundException Message=Could not find a part of the path '/usr/share/fonts/truetype'.

Im wondering if someone could help me out, im unsure what i need to do to get this to work..

My code for creating the PDF:
using PdfSharp.Xamarin;
using PdfSharpCore.Pdf;
using PdfSharpCore.Drawing;

public void FileWriter(string[] Data, string FileName) // Code to generate a PDF file
PdfDocument MyPDF = new PdfDocument();
PdfPage MyFirstPage = MyPDF.Pages.Add();
XGraphics Mygraphics = XGraphics.FromPdfPage(MyFirstPage);
XFont font = new XFont("Verdana", 20); //This is where the error appears

int x = 10, y = 10;
foreach (string Info in Data)
Mygraphics.DrawString(Info, font, XBrushes.Black, new XPoint(x, y));
y += 100;
MemoryStream stream = new MemoryStream();
DependencyService.Get<ISave>().SaveToDownloads(FileName, "application / pdf", stream);

Any help on this will be greatly appreciated

Author:  Thomas Hoevel [ Thu Dec 12, 2019 2:08 pm ]
Post subject:  Re: Could not find a part of the path '/usr/share/fonts/true

Achristie wrote:
Hi, Im using PDFSharp.Xamarin […]
Wrong forum.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group