« ChartDirector 6.3 Rel… | Home | Fix for missing acces… »

Write formatted text with DynaPDF


As you may know you can use MBS Plugins with Xojo and FileMaker to write PDFs with DynaPDF functions. The WriteFText functions accept formatting commands in the text, so you can create various formats. We got a few examples in the following Xojo source code:
  • 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.
Check the sample code here:

// 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.
06 11 18 - 19:13
No comments

  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.