VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Bold text using PdfGraphics DrawString?



Bold text using PdfGraphics DrawString?

Post by jhaacke »

I'm trying to figure out how to draw bolded text using PdfGraphic's DrawString method. It looks like there is a single overload that allows you to pass in a PdfPen, and the PdfPen has a "Width" property that would probably due the trick. However, all the other overloads use PdfBrush and I need to use one of those overloads. Is there a way to draw bolded text using DrawString with a PdfBrush?


Re: Bold text using PdfGraphics DrawString?

Post by Alex »

Hello,

Pen is used for drawing lines or curves. Brush is used for filling contours. Font is used for adjustment of text parameters.

You need create bold font if you want to use bold text.

Best regards, Alexander


Re: Bold text using PdfGraphics DrawString?

Post by jhaacke »

Thank you for the response. I'm not sure how to create a bold font with PdfFont. To create a PdfFont, I am currently doing this:

var font = document.FontManager.CreateCIDFontFromTrueTypeFont( PdfFontManager.GetSystemTrueTypeFontFileName( fontName ) )

It doesn't seem like there is any opportunity to specify font style such as Bold when creating the font.

With .Net's System.Drawing.Font class, it's easy because FontStyle is included in an overload of the constructor. But PdfFont doesn't seem to provide this.


Re: Bold text using PdfGraphics DrawString?

Post by Alex »

Hello,

You can create TrueType font, for example Arial Bold font, using the PdfFontManager class:
https://www.vintasoft.com/docs/vsimaging ... nager.html

Best regards, Alexander


Page 1 from 1: 1