Frequently Asked Question:
how to set bold font
I'm using DrawText . I need the text to be Bold while printing .
SetFontFlags(0, 0, 0, 0, 0, 0, 0, 1); has no effeect
applyStyle('Bold'); has no effeect
The only thing that helps is calling DrawText twice but it makes the font bold on screen only and in the printed version it looks regular
The SetFontFlags function is for advanced use only and in this case won't help you set a bold font in the fashion that you want it to.
If you want to draw some bold text onto a PDF then before you call the DrawText function you need to add a bold font to your document (e.g. Arial Bold). Here is an example of how to add bold text to a document:
// Use the AddTrueTypeFont function to add a bold font to
// the default blank document and get the return
// value which is the font ID.
fontID1 = QP.AddTrueTypeFont("Arial Rounded MT Bold", 1);
// Select the font using its font ID
QP.SelectFont(fontID1);
// Draw some text onto the document to see if
// everything is working OK.
QP.DrawText(100, 700, "Arial Rounded MT Bold");
Arial Regular and Arial Bold are different fonts, so if you want to write regular Arial text and then write bold Arial text, then you need to add two different fonts to the document.