Crankedup.com

 RTFTools for 4D
Programmed by Art Wallace
email: support@crankedup.com

About this package:
A small source code library that I wrote several years ago for the 4th Dimension database environment to enable developers to produce RTF documents quickly. Because 4D does not offer any native rich text support this library offers a simple and no-cost way for 4D-based database solutions to produce reports and pre-merged Word documents that are otherwise not possible.

RTFTools is a collection of methods that provide simple building blocks which you can use to create RTF documents from within 4D. Only a minimal subset of the RTF specification is implemented.

Download:
PC .zip archive: rtftools_r4_pc.zip
Mac StuffIt 5 archive: rtftools_r4_mac.hqx

Version History:
2000-10-22 - 4th release available
1999-12-09 - 3rd release available
1999-05-19 - 2nd release available
1999-03-21 - beta available
1999-03-19 - 1st release available

Requirements:
4th Dimension v6.5.x or v6.7.x
4D_PACK Plug-in

Limitations / Known Bugs:

  • [bug] Color table is not created
  • [bug] StyleSheets cannot be applied to the first paragraph of a document page (this is only an issue when you manually create a page break)
  • Tools_RTF_Prefs_SetRulerUnit - Inches is the only ruler measurement supported.
  • Tools_RTF_File_SetType only works on the Mac, PC users must make sure their files end with the ".rtf" extension.
  • Tools_RTF_Info_DefaultTabSpace - not implemented yet
  • Tools_RTF_Info_Margins - not implemented yet
  • Tools_RTF_Info_PaperSize - not implemented yet

To see what RTFTools can do:
Go to the User environment in 4D and Execute the method "Export_ContactLetter". This will create a sample RTF mail merge file.

RTFTools consists of the following methods:

  • Tools_RTF_Area_Footer
  • Tools_RTF_Area_Header
  • Tools_RTF_Area_Info
  • Tools_RTF_Area_ParaBegin
  • Tools_RTF_Area_ParaEnd
  • Tools_RTF_Color_Make
  • Tools_RTF_Color_Use
  • Tools_RTF_Convert_ToTwip
  • Tools_RTF_File_CheckArrays
  • Tools_RTF_File_Close
  • Tools_RTF_File_Create
  • Tools_RTF_File_GetDocRef
  • Tools_RTF_File_GetFileName
  • Tools_RTF_File_GetPath
  • Tools_RTF_File_GetPathName
  • Tools_RTF_File_OpenInReader
  • Tools_RTF_File_SetType
  • Tools_RTF_File_Write
  • Tools_RTF_Font_Bold
  • Tools_RTF_Font_Italic
  • Tools_RTF_Font_Make
  • Tools_RTF_Font_Reset
  • Tools_RTF_Font_Size
  • Tools_RTF_Font_Underline
  • Tools_RTF_Font_Use
  • Tools_RTF_Info_DefaultTabSpace
  • Tools_RTF_Info_Margins
  • Tools_RTF_Info_PaperSize
  • Tools_RTF_Insert_CR
  • Tools_RTF_Insert_Date
  • Tools_RTF_Insert_PageBreak
  • Tools_RTF_Insert_PageNumber
  • Tools_RTF_Insert_Quote
  • Tools_RTF_Insert_Tab
  • Tools_RTF_Insert_Time
  • Tools_RTF_Log_Error
  • Tools_RTF_Prefs_SetRulerUnit
  • Tools_RTF_Setup_Variables
  • Tools_RTF_Stylesheet_Make
  • Tools_RTF_Stylesheet_Use
  • Tools_RTF_Tab_BuildSet
  • Tools_RTF_Tab_Make