Hi all,
Im using PDFsharp and trying to create some output with some special fonts and somehow I cannot display all of them on a pdf.
If I want to display an other font in my Windows Form Application, I do this:
Code:
private void Form1_Load(object sender, EventArgs e)
{
Label l = new Label();
l.Text = "ÌtestwÎ";
this.Font = new Font("Code 128", 80);
l.Size = new System.Drawing.Size(300, 300);
this.Controls.Add(l);
this.Size = new Size(300, 300);
}
As output I get a Window with my font (barcode), everything is fine
Attachment:
File comment: font in windows form
form.jpg [ 12.11 KiB | Viewed 12581 times ]
Now I would like to use the same font and the same string and write it in a pdf. That should work well. I try something like this:
Code:
PdfDocument doc = new PdfDocument();
PdfPage page = doc.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
gfx.DrawString("ÌtestwÎ", new XFont("Code 128", 80), XBrushes.Black, 50, 100);
If I open my pdf I get this
Attachment:
File comment: same font in pdf
pdf.jpg [ 18.4 KiB | Viewed 12581 times ]
I think everything is alright, there is just some trouble with the start and end characters
Ì and
Î But why?
How to avoid this issue? Any ideas? Thank you
PS: I downloaded the font from
http://www.jtbarton.com/Barcodes/Code128.aspx But I think thats not that important.