Adding a cutom font and dashed line

Hi,

I'm back again with two questions.

First question:
I have been trying to figure out all day today how to add a custom font to a PDF. In the code sample, you have the following:

PdfTextElement txtElement = new PdfTextElement(text);
txtElement.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 24)

How can I change the font to one that I've personally added into the project? (For example, Elephant font is one font I'd like to render to PDF.)


Second question:
Would it be possible to provide a quick code sample on how to create a dashed line? I'd like that line to divide my header and the main body.

Thanks for any help you can provide; as you can tell, I'm a newbie grasping my way around these controls..!

3 Replies

PH Praveenkumar H Syncfusion Team September 2, 2014 05:05 AM UTC

Hi Coder,

Thank you for using syncfusion products,

First question:

Currently we don't have the support for using the custom font , we have already logged the feature request "Need add the support to use custom font in Windows phone platform". we will update you once the feature has been implemented.

Second question:

We can draw dashed line as follow,

PdfPen pen = new PdfPen(PdfBrushes.Red);

pen.DashStyle = PdfDashStyle.Dash;

page.Graphics.DrawLine(pen, new PointF(10, 10), new PointF(100, 10));

Please let us know if you need further assistance.

With Regards,

Praveen



CO Coder September 2, 2014 10:19 PM UTC

Hi Praveeen,

Thank you very much for your assistance! Looking forward to seeing those features implemented in the future.


PH Praveenkumar H Syncfusion Team September 4, 2014 04:36 AM UTC

Hi,

Thank you for your update,

We will update you once the feature has been implemented.

With Regards,

Praveen


Loader.
Up arrow icon