PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Include font in PDF when using Migradoc
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1508
Page 1 of 1

Author:  petersmith [ Sat Jan 15, 2011 4:51 pm ]
Post subject:  Include font in PDF when using Migradoc

I want to include a barcode font in my PDF so that the client does not have to have this font installed to have the PDF displayed correctly.

Here's what I have now:

Dim fonttype As String = "Free 3 of 9 Extended"
Dim fontsize As Integer = 40
(..)
row = tbl.AddRow
Dim font As New MigraDoc.DocumentObjectModel.Font
font.Name = fonttype
font.Size = MigraDoc.DocumentObjectModel.Unit.FromPoint(fontsize)
row.Cells(0).Format.Font.ApplyFont(font)
row.Cells(0).AddParagraph("*" + userTicketsDT.Item(0).barcode.ToString + "*")
(..)
Dim docRenderer As MigraDoc.Rendering.DocumentRenderer = New MigraDoc.Rendering.DocumentRenderer(doc)
docRenderer.PrepareDocument()
docRenderer.RenderObject(gfx, XUnit.FromMillimeter(96), XUnit.FromMillimeter(228), "12cm", tbl)


I was given this advice earlier:
---------------------------------------------------------
You specify this when creating a font in PDFsharp:
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
http://www.pdfsharp.net/wiki/Unicode-sample.ashx
For MigraDoc:
http://www.pdfsharp.net/wiki/MigraDocHe ... ample.ashx
---------------------------------------------------------

But I dont know how to combine that with my existing code...can anyone help me? This is the last step in my project so after this I'm done! Help is really appreciated as such!!!!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/