You've already forked lazarus-ccr
applications
bindings
components
Comba_Animation
aboutcomponent
acs
beepfp
callite
captcha
chelper
chemtext
cmdline
cmdlinecfg
colorpalette
cryptini
csvdocument
epiktimer
everettrandom
examplecomponent
exctrls
extrasyn
fpexif
fpsound
fpspreadsheet
fractions
freetypepascal
geckoport
gradcontrols
grid_semaphor
gridprinter
industrialstuff
iosdesigner
iphonelazext
jujiboutils
jvcllaz
kcontrols
lazautoupdate
lazbarcodes
lazmapviewer
lclextensions
longtimer
manualdock
mbColorLib
mplayer
multithreadprocs
nicechart
nicegrid
nicesidebar
nvidia-widgets
onguard
orpheus
playsoundpackage
poweredby
powerpdf
rgbgraphics
richmemo
richview
rtfview
rx
scrolltext
smnetgradient
spktoolbar
splashabout
svn
systools
tdi
thtmlport
tparadoxdataset
tvplanit
xdev_toolkit
CFHelpers.pas
CvtHelp.pas
HelpUtil.pas
PrefsUtil.pas
PropListUtil.pas
ReadMe.txt
RtfDoc.pas
TestRtfDoc.pas
ViewDoc.pas
ViewWith.pas
XDevStatus.html
create_app_mac.sh
dfmtolfm.ini
dfmtolfm.pas
filelist.txt
makepasx.pas
makever.pas
zlibar
zmsql
examples
image_sources
lclbindings
wst
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@366 8e941d3f-bd1b-0410-a28a-d453659cc2b4
53 lines
1.1 KiB
ObjectPascal
53 lines
1.1 KiB
ObjectPascal
program TestRtfDoc;
|
|
|
|
{
|
|
Test program for RtfDoc unit.
|
|
}
|
|
|
|
{$IFDEF FPC}
|
|
{$MODE Delphi}
|
|
{$ELSE}
|
|
{$APPTYPE CONSOLE}
|
|
{$ENDIF}
|
|
{$R+,Q+}
|
|
|
|
uses
|
|
SysUtils,
|
|
RtfPars, {Free Pascal unit with TRtfParser class and rtf constants}
|
|
RtfDoc; {Descendant class used in this program}
|
|
|
|
begin
|
|
|
|
with TRtfDoc.Create do {Create TRtfDoc object}
|
|
begin
|
|
try
|
|
|
|
try
|
|
Start('test.rtf'); {Create RTF file}
|
|
except
|
|
on EInOutError do {File read-only or some other I/O error}
|
|
begin
|
|
WriteLn('Can''t create file');
|
|
Exit;
|
|
end;
|
|
end;
|
|
|
|
OutDefaultFontTable(2); {Select font 2 (Arial) as default}
|
|
|
|
OutCtrl(rtfParAttr, rtfQuadCenter, rtfNoParam); {Center line}
|
|
OutCtrl(rtfCharAttr, rtfBold, 1); {Turn on bolding}
|
|
OutText('Hello'); {Output some text}
|
|
OutCtrl(rtfCharAttr, rtfBold, 0); {Turn off bolding}
|
|
OutText(' there!'); {Output some more text}
|
|
OutCtrl(rtfSpecialChar, rtfPar, rtfNoParam); {End of paragraph}
|
|
|
|
Done; {Close RTF file}
|
|
|
|
finally
|
|
Free; {Free TRtfDoc object}
|
|
end;
|
|
end;
|
|
|
|
end.
|
|
|