PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Feb 28, 2020 3:30 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Dec 12, 2019 11:54 am 
Offline

Joined: Thu Dec 12, 2019 11:43 am
Posts: 1
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:
Quote:
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();
MyPDF.Save(stream);
DependencyService.Get<ISave>().SaveToDownloads(FileName, "application / pdf", stream);


Any help on this will be greatly appreciated


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 12, 2019 2:08 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3027
Location: Cologne, Germany
Achristie wrote:
Hi, Im using PDFSharp.Xamarin […]
Wrong forum.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 158 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group