Write formatted text with DynaPDF
- Change text rise and size to get footnote references
- Change font to get e.g. a bold font
- Change color
- Create lists with hierarchies, numbered entries or multiline entries.
// set font
call pdf.SetFont "Helvetica", 0, 12.0, true, pdf.kcpUnicode
dim y as Double = 50
// change font size and raise for foot note references
text = "\FS[12]Hello World\FS[6]\TR[6]123\TR[0]\FS[12] Just a test."
call pdf.WriteFTextEx(50, y, 200, -1, pdf.ktaLeft, text)
y = y + 20
// change font to get bold
text = "\FT[Helvetica]Hello \FT[Helvetica-Bold]World \FT[Helvetica]everyone."
call pdf.WriteFTextEx(50, y, 200, -1, pdf.ktaLeft, text)
y = y + 20
// change color in the text
text = _
"\FC[" + str(DynaPDFMBS.RGB(255, 0, 0)) + "]Red "+_
"\FC[" + str(DynaPDFMBS.RGB(0, 255, 0)) + "]Green "+_
"\FC[" + str(DynaPDFMBS.RGB(0, 0, 255)) + "]Blue "+_
"\FC[" + str(DynaPDFMBS.RGB(0, 0, 0)) + "]Black "
call pdf.WriteFTextEx(50, y, 200, -1, pdf.ktaLeft, text)
y = y + 20
// make list
text = _
"\LI[0]First"+EndOfLine+"with two lines\EL#"+_
"\LI[0]Second\EL# "+_
"\LI[0]Third\EL#"
call pdf.WriteFTextEx(50, y, 200, -1, pdf.ktaLeft, text)
The same formatting texts can be used in FileMaker, Xojo and any other development tool supported by DynaPDF like C++, VB, PHP and Delphi.